]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Another small optimization.
authorBart Van Assche <bvanassche@acm.org>
Tue, 25 Mar 2008 19:16:20 +0000 (19:16 +0000)
committerBart Van Assche <bvanassche@acm.org>
Tue, 25 Mar 2008 19:16:20 +0000 (19:16 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7790

exp-drd/drd_bitmap.h

index d111ceb4831c44bcaf692cd9bbf55600037742c4..23ef6372c3bdefa57946000c20bae7c82530775f 100644 (file)
@@ -434,7 +434,14 @@ struct bitmap2* bm2_lookup_or_insert(const struct bitmap* const bm,
   struct bitmap2* bm2;
 
   tl_assert(bm);
-  if (! bm_cache_lookup(bm, a1, &bm2) || bm2 == 0)
+  if (bm_cache_lookup(bm, a1, &bm2))
+  {
+    if (bm2 == 0)
+    {
+      bm2 = bm2_insert(bm, a1);
+    }
+  }
+  else
   {
     bm2ref = VG_(OSetGen_Lookup)(bm->oset, &a1);
     if (bm2ref)