From: Bart Van Assche Date: Tue, 25 Mar 2008 19:16:20 +0000 (+0000) Subject: Another small optimization. X-Git-Tag: svn/VALGRIND_3_4_0~796 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41991488a69197a92d9fcc7adae81ceab0d939f9;p=thirdparty%2Fvalgrind.git Another small optimization. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7790 --- diff --git a/exp-drd/drd_bitmap.h b/exp-drd/drd_bitmap.h index d111ceb483..23ef6372c3 100644 --- a/exp-drd/drd_bitmap.h +++ b/exp-drd/drd_bitmap.h @@ -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)