[polari/wip/fmuellner/combined-gsoc: 126/137] userTracker: Don't split out disconnectSignals() method



commit a51f8265effc796dd0d5341a75ec5b2f53a090af
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jul 26 23:31:40 2016 +0200

    userTracker: Don't split out disconnectSignals() method
    
    It can be replaced by a one-liner in the only place it is used ...

 src/userTracker.js |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/src/userTracker.js b/src/userTracker.js
index 43b286b..50df82a 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -125,7 +125,7 @@ const UserTracker = new Lang.Class({
         if (room.account != this._account)
             return;
 
-        this._disconnectRoomSignalsForRoom(room);
+        this._getRoomSignals(room).forEach(id => { room.disconnect(id); });
         this._clearUsersFromRoom(room);
         this._deleteRoomData(room);
     },
@@ -157,15 +157,6 @@ const UserTracker = new Lang.Class({
         }));
     },
 
-    _disconnectRoomSignalsForRoom: function(room) {
-        let currentRoomSignals = this._getRoomSignals(room);
-
-        for (let i = 0; i < currentRoomSignals.length; i++) {
-            room.disconnect(currentRoomSignals[i]);
-        }
-        currentRoomSignals = [];
-    },
-
     _onChannelChanged: function(room) {
         if (!room.channel) {
             this._clearUsersFromRoom(room);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]