[llvm-commits] [llvm] r42629 - /llvm/trunk/include/llvm/ADT/SparseBitVector.h

Daniel Berlin dberlin at dberlin.org
Thu Oct 4 22:10:54 PDT 2007


Author: dannyb
Date: Fri Oct  5 00:10:53 2007
New Revision: 42629

URL: http://llvm.org/viewvc/llvm-project?rev=42629&view=rev
Log:
Fix intersectWithComplement bug noticed by Curtis Dunham
Optimize |= case for empty RHS

Modified:
    llvm/trunk/include/llvm/ADT/SparseBitVector.h

Modified: llvm/trunk/include/llvm/ADT/SparseBitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseBitVector.h?rev=42629&r1=42628&r2=42629&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Fri Oct  5 00:10:53 2007
@@ -580,8 +580,8 @@
     ElementListIter Iter1 = Elements.begin();
     ElementListConstIter Iter2 = RHS.Elements.begin();
 
-    // Check if both bitmaps are empty
-    if (Elements.empty() && RHS.Elements.empty())
+    // If RHS is empty, we are done
+    if (RHS.Elements.empty())
       return false;
 
     while (Iter2 != RHS.Elements.end()) {
@@ -671,9 +671,7 @@
         }
         ++Iter2;
       } else {
-        ElementListIter IterTmp = Iter1;
         ++Iter1;
-        Elements.erase(IterTmp);
       }
     }
     CurrElementIter = Elements.begin();





More information about the llvm-commits mailing list