Parcourir la source

[2811] Explicitly break out of loop after rebalancing tree

Mukund Sivaraman il y a 12 ans
Parent
commit
07f6240583
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      src/lib/datasrc/memory/domaintree.h

+ 6 - 0
src/lib/datasrc/memory/domaintree.h

@@ -2082,6 +2082,12 @@ DomainTree<T>::insertRebalance
             } else {
                 leftRotate(subtree_root, grandparent);
             }
+
+            // In this case, the tree is ready now and we explicitly
+            // break out of the loop here. Even if we continue the loop,
+            // it will exit the loop in case 2 above, but that's not so
+            // obvious.
+            break;
         }
     }