From fd086d757ee429189ded22db143dd080d420eab1 Mon Sep 17 00:00:00 2001 From: Gatsbill Date: Thu, 16 Feb 2017 13:36:19 +0100 Subject: [PATCH] [refactor] Remove useless self var (#45) --- index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 7005511159..a664a1482f 100644 --- a/index.js +++ b/index.js @@ -164,19 +164,18 @@ Adapter.prototype.clients = function(rooms, fn){ rooms = rooms || []; var ids = {}; - var self = this; var sids = []; var socket; if (rooms.length) { for (var i = 0; i < rooms.length; i++) { - var room = self.rooms[rooms[i]]; + var room = this.rooms[rooms[i]]; if (!room) continue; var sockets = room.sockets; for (var id in sockets) { if (sockets.hasOwnProperty(id)) { if (ids[id]) continue; - socket = self.nsp.connected[id]; + socket = this.nsp.connected[id]; if (socket) { sids.push(id); ids[id] = true; @@ -185,9 +184,9 @@ Adapter.prototype.clients = function(rooms, fn){ } } } else { - for (var id in self.sids) { - if (self.sids.hasOwnProperty(id)) { - socket = self.nsp.connected[id]; + for (var id in this.sids) { + if (this.sids.hasOwnProperty(id)) { + socket = this.nsp.connected[id]; if (socket) sids.push(id); } }