We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c642e2a commit cd87122Copy full SHA for cd87122
llvm/include/llvm/ADT/SparseBitVector.h
@@ -119,8 +119,8 @@ template <unsigned ElementSize = 128> struct SparseBitVectorElement {
119
120
size_type count() const {
121
unsigned NumBits = 0;
122
- for (unsigned i = 0; i < BITWORDS_PER_ELEMENT; ++i)
123
- NumBits += llvm::popcount(Bits[i]);
+ for (BitWord Bit : Bits)
+ NumBits += llvm::popcount(Bit);
124
return NumBits;
125
}
126
@@ -799,11 +799,8 @@ class SparseBitVector {
799
800
unsigned count() const {
801
unsigned BitCount = 0;
802
- for (ElementListConstIter Iter = Elements.begin();
803
- Iter != Elements.end();
804
- ++Iter)
805
- BitCount += Iter->count();
806
-
+ for (const auto &Elem : Elements)
+ BitCount += Elem.count();
807
return BitCount;
808
809
0 commit comments