]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
bitmap.c (bitmap_find_bit): Return early if we have the correct element cached.
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 24 May 2002 12:23:36 +0000 (12:23 +0000)
committerDavid S. Miller <davem@gcc.gnu.org>
Fri, 24 May 2002 12:23:36 +0000 (05:23 -0700)
2002-05-21  Richard Earnshaw  <rearnsha@arm.com>

* bitmap.c (bitmap_find_bit): Return early if we have the correct
element cached.

From-SVN: r53838

gcc/ChangeLog
gcc/bitmap.c

index 68f8af258c108cb819db0cc02e30fe1491aa7365..dde3ea05e2ca704971deb019b35f569e9a38b71a 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-21  Richard Earnshaw  <rearnsha@arm.com>
+
+       * bitmap.c (bitmap_find_bit): Return early if we have the correct
+       element cached.
+
 2002-05-24  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * cppinit.c (mark_named_operators): Split out from init_builtins.
index b735d1409d0b276069e077ac6e84d1f11eb7f7fb..786689b4ad52d8245a984b591972b10c0f7a8656 100644 (file)
@@ -300,8 +300,9 @@ bitmap_find_bit (head, bit)
   bitmap_element *element;
   unsigned HOST_WIDE_INT indx = bit / BITMAP_ELEMENT_ALL_BITS;
 
-  if (head->current == 0)
-    return 0;
+  if (head->current == 0
+      || head->indx == indx)
+    return head->current;
 
   if (head->indx > indx)
     for (element = head->current;