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
--- 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;