summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/SparseBitVector.h
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2007-10-05 05:10:53 +0000
committerDaniel Berlin <dberlin@dberlin.org>2007-10-05 05:10:53 +0000
commitad92c633c7845e3a8103db5a9ae9231c03b9fb58 (patch)
treedbb1fd80f87e9382d3e66255ccc9b061ec9ad85a /include/llvm/ADT/SparseBitVector.h
parenteca18214bbeb25de131bff528b4e191579b5f699 (diff)
downloadllvm-ad92c633c7845e3a8103db5a9ae9231c03b9fb58.tar.gz
llvm-ad92c633c7845e3a8103db5a9ae9231c03b9fb58.tar.bz2
llvm-ad92c633c7845e3a8103db5a9ae9231c03b9fb58.tar.xz
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/SparseBitVector.h')
-rw-r--r--include/llvm/ADT/SparseBitVector.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/llvm/ADT/SparseBitVector.h b/include/llvm/ADT/SparseBitVector.h
index 1d96546954..86fb2b4eb4 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();