Bug 1059555 - Fix js/src/SplayTree forEach to not inadvertantly copy the callback functor. r=bhackett
authorKannan Vijayan <kvijayan@mozilla.com>
Thu, 28 Aug 2014 12:18:44 -0400
changeset 223854 a2481fd3296c6f4ba35cbf22743b8a86474deac5
parent 223853 aed61458371b3d342433d9543c89ea6001ef3043
child 223855 b7d78e4bdddece114f3b45d03556bfdfade3fa88
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1059555
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1059555 - Fix js/src/SplayTree forEach to not inadvertantly copy the callback functor. r=bhackett
js/src/ds/SplayTree.h
--- a/js/src/ds/SplayTree.h
+++ b/js/src/ds/SplayTree.h
@@ -133,17 +133,17 @@ class SplayTree
         freeNode(swap);
 
         checkCoherency(root, nullptr);
     }
 
     template <class Op>
     void forEach(Op op)
     {
-        forEachInner(op, root);
+        forEachInner<Op>(op, root);
     }
 
   private:
 
     Node *lookup(const T &v)
     {
         JS_ASSERT(root);
         Node *node = root, *parent;
@@ -240,19 +240,19 @@ class SplayTree
     }
 
     template <class Op>
     void forEachInner(Op op, Node *node)
     {
         if (!node)
             return;
 
-        forEachInner(op, node->left);
+        forEachInner<Op>(op, node->left);
         op(node->item);
-        forEachInner(op, node->right);
+        forEachInner<Op>(op, node->right);
     }
 
     Node *checkCoherency(Node *node, Node *minimum)
     {
 #ifdef DEBUG
         if (!node) {
             JS_ASSERT(!root);
             return nullptr;