Bug 955366 - Use Maps and Sets in IRC code: fix removing modes. r=aleth
authorPatrick Cloke <clokep@gmail.com>
Mon, 19 May 2014 13:19:56 -0400
changeset 16206 6ee809fb4c458bbbf0b4c946c418c00d085c986e
parent 16205 bcd505d238393fe60d7c9ffe0c452d267ef75d9d
child 16207 9001c159773fb2ee682287bb70db0472aaafade9
push id10134
push userclokep@gmail.com
push dateMon, 19 May 2014 17:20:23 +0000
treeherdercomm-central@3cb370e6812d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleth
bugs955366
Bug 955366 - Use Maps and Sets in IRC code: fix removing modes. r=aleth
chat/protocols/irc/irc.js
--- a/chat/protocols/irc/irc.js
+++ b/chat/protocols/irc/irc.js
@@ -92,17 +92,17 @@ function ircMessage(aData) {
 //   aAddNewMode is true if modes are being added, false otherwise.
 //   aNewModes is an array of mode characters.
 function _setMode(aAddNewMode, aNewModes) {
   // Check each mode being added/removed.
   for each (let newMode in aNewModes) {
     let hasMode = this._modes.has(newMode);
     // If the mode is in the list of modes and we want to remove it.
     if (hasMode && !aAddNewMode)
-      this._modes.remove(newMode);
+      this._modes.delete(newMode);
     // If the mode is not in the list of modes and we want to add it.
     else if (!hasMode && aAddNewMode)
       this._modes.add(newMode);
   }
 }
 
 // This copies all the properties of aBase to aPrototype (which is expected to
 // be the prototype of an object). This is necessary because JavaScript does not