Bug 954667 - sortComparator is sometimes called with the contact element instead of the contact object, r=florian.
authorPatrick Cloke <clokep@gmail.com>
Sun, 15 Jan 2012 23:43:44 +0100
changeset 18517 5c6c9d5a540b5c07d438b8e155d3d77c11d8a60e
parent 18516 abc3bc15fe428e55cba1691d245df21cb693fb4f
child 18518 6eff20a4f25d314c0edca61277bfb6c167c6703b
push id1103
push usermbanner@mozilla.com
push dateTue, 18 Mar 2014 07:44:06 +0000
treeherdercomm-beta@50c6279a0af0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs954667
Bug 954667 - sortComparator is sometimes called with the contact element instead of the contact object, r=florian.
im/content/group.xml
--- a/im/content/group.xml
+++ b/im/content/group.xml
@@ -237,21 +237,21 @@
 
         var contactElt = document.createElement("contact");
         if (this.hasAttribute("closed"))
           contactElt.setAttribute("collapsed", "true");
 
         let end = this.contacts.length;
         // Avoid the binary search loop if the contacts were already sorted.
         if (end != 0 &&
-            this.sortComparator(aContact, this.contacts[end - 1]) < 0) {
+            this.sortComparator(aContact, this.contacts[end - 1].contact) < 0) {
           let start = 0;
           while (start < end) {
             let middle = start + Math.floor((end - start) / 2);
-            if (this.sortComparator(aContact, this.contacts[middle]) < 0)
+            if (this.sortComparator(aContact, this.contacts[middle].contact) < 0)
               end = middle;
             else
               start = middle + 1;
           }
         }
         var last = end == 0 ? this : this.contacts[end - 1];
         this.parentNode.insertBefore(contactElt, last.nextSibling);
         contactElt.build(aContact, this);