diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2007-10-05 05:10:53 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@dberlin.org> | 2007-10-05 05:10:53 +0000 |
commit | ad92c633c7845e3a8103db5a9ae9231c03b9fb58 (patch) | |
tree | dbb1fd80f87e9382d3e66255ccc9b061ec9ad85a /include/llvm/ADT | |
parent | eca18214bbeb25de131bff528b4e191579b5f699 (diff) | |
download | external_llvm-ad92c633c7845e3a8103db5a9ae9231c03b9fb58.zip external_llvm-ad92c633c7845e3a8103db5a9ae9231c03b9fb58.tar.gz external_llvm-ad92c633c7845e3a8103db5a9ae9231c03b9fb58.tar.bz2 |
Fix intersectWithComplement bug noticed by Curtis Dunham
Optimize |= case for empty RHS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r-- | include/llvm/ADT/SparseBitVector.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/llvm/ADT/SparseBitVector.h b/include/llvm/ADT/SparseBitVector.h index 1d96546..86fb2b4 100644 --- a/include/llvm/ADT/SparseBitVector.h +++ b/include/llvm/ADT/SparseBitVector.h @@ -580,8 +580,8 @@ public: 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 @@ public: } ++Iter2; } else { - ElementListIter IterTmp = Iter1; ++Iter1; - Elements.erase(IterTmp); } } CurrElementIter = Elements.begin(); |