Skip to content

Commit

Permalink
[refactor] Remove useless self var (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
billouboq authored and darrachequesne committed Feb 16, 2017
1 parent 9a621ec commit fd086d7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand Down

0 comments on commit fd086d7

Please sign in to comment.