From 57075892dea72e25f1ee12ffff44bdb45ca88790 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Tue, 26 Aug 2014 23:33:47 -0400 Subject: [PATCH] Minor optimization to BattleRoom updating --- rooms.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rooms.js b/rooms.js index 75b922aee6..389292868f 100644 --- a/rooms.js +++ b/rooms.js @@ -751,11 +751,9 @@ var BattleRoom = (function () { }; BattleRoom.prototype.update = function (excludeUser) { if (this.log.length <= this.lastUpdate) return; - var message = this.log.slice(this.lastUpdate).join('\n'); this.lastUpdate = this.log.length; - message = '>' + this.id + '\n\n' + message; - Sockets.subchannelBroadcast(this.id, message); + Sockets.subchannelBroadcast(this.id, '>' + this.id + '\n\n' + this.log.slice(this.lastUpdate).join('\n')); // empty rooms time out after ten minutes var hasUsers = false;