]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Trim some fat; removing this assertion makes Remove() about 5% faster.
authorNicholas Nethercote <njn@valgrind.org>
Sun, 14 Aug 2005 23:00:57 +0000 (23:00 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 14 Aug 2005 23:00:57 +0000 (23:00 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4413

coregrind/m_oset.c

index 41b57447dc12deb8bf1227d30fe6033647f1e079..b170d020ebe08fca5a15d51180ae9ece94f88bf7 100644 (file)
@@ -358,9 +358,7 @@ static inline Int cmp_key_root(AvlTree* t, AvlNode* n)
 // Returns True if the depth of the tree has grown.
 static Bool avl_insert(AvlTree* t, AvlNode* n)
 {
-   Int cmpres;
-
-   cmpres = cmp_key_root(t, n);
+   Int cmpres = cmp_key_root(t, n);
 
    if (cmpres < 0) {
       // Insert into the left subtree.
@@ -517,11 +515,7 @@ static Bool avl_removeroot(AvlTree* t);
 static Bool avl_remove(AvlTree* t, AvlNode* n)
 {
    Bool ch;
-   Int  cmpres;
-
-   vg_assert(t && t->root);
-   
-   cmpres = cmp_key_root(t, n);
+   Int  cmpres = cmp_key_root(t, n);
 
    if (cmpres < 0) {
       // Remove from the left subtree