mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-06-19 15:11:30 -05:00
Minor optimization to BattleRoom updating
This commit is contained in:
parent
e3c7050b29
commit
57075892de
4
rooms.js
4
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user