]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/baseuiwindow.js
use home-made string hashset/map instead of js default
[irc/quakenet/qwebirc.git] / js / ui / baseuiwindow.js
index 6179b3515ccff0f4452f70be31eaa8189725571d..22200adb40055aa7794874d36646774fbda793c5 100644 (file)
@@ -21,7 +21,7 @@ qwebirc.ui.Window = new Class({
     this.commandhistory = this.parentObject.commandhistory;
     this.scrolleddown = true;
     this.scrollpos = null;
-    this.lastNickHash = {};
+    this.lastNickHash = new QHash();
     this.lastSelected = null;
     this.subWindow = null;
     this.closed = false;
@@ -204,26 +204,27 @@ qwebirc.ui.Window = new Class({
     }
   },
   updateNickList: function(nicks) {
-    var nickHash = {}, present = {};
+    var nickHash = new QHash(), present = new QSet();
     var added = [];
     var lnh = this.lastNickHash;
     
     for(var i=0;i<nicks.length;i++)
-      present[nicks[i]] = 1;
-    
-    for(var k in lnh)
-      if(!present[k])
-        this.nickListRemove(k, lnh[k]);
-        
+      present.add(nicks[i]);
+
+    lnh.each(function(k, v) {
+      if(!present.contains(k))
+        this.nickListRemove(k, v);
+    }, this);
+
     for(var i=0;i<nicks.length;i++) {
       var n = nicks[i];
-      var l = lnh[n];
+      var l = lnh.get(n);
       if(!l) {
         l = this.nickListAdd(n, i);
         if(!l)
           l = 1;
       }
-      nickHash[n] = l;
+      nickHash.put(n, l);
     }
     
     this.lastNickHash = nickHash;