bug 1464999 - make SplayTree.remove clear mRight and mLeft r?njn draft
authorDaniel Stenberg <daniel@haxx.se>
Tue, 29 May 2018 09:41:24 +0200
changeset 800960 5fb6d71e1788ad26f30ee36cbffd289795dc1628
parent 800719 35aa0dde259f5f51c0aaf86935a54b8087c2e8c6
push id111529
push userbmo:daniel@haxx.se
push dateTue, 29 May 2018 14:49:09 +0000
reviewersnjn
bugs1464999
milestone62.0a1
bug 1464999 - make SplayTree.remove clear mRight and mLeft r?njn ... to allow a user to remove() an entry, update the values and re-insert() it into a tree. MozReview-Commit-ID: GrSY90Q3ugt
mfbt/SplayTree.h
--- a/mfbt/SplayTree.h
+++ b/mfbt/SplayTree.h
@@ -143,16 +143,18 @@ public:
     mRoot->mRight = last->mRight;
     if (mRoot->mLeft) {
       mRoot->mLeft->mParent = mRoot;
     }
     if (mRoot->mRight) {
       mRoot->mRight->mParent = mRoot;
     }
 
+    last->mLeft = nullptr;
+    last->mRight = nullptr;
     return last;
   }
 
   T* removeMin()
   {
     MOZ_ASSERT(mRoot, "No min to remove!");
 
     T* min = mRoot;