File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,8 @@ template <unsigned ElementSize = 128> struct SparseBitVectorElement {
119
119
120
120
size_type count () const {
121
121
unsigned NumBits = 0 ;
122
- for (unsigned i = 0 ; i < BITWORDS_PER_ELEMENT; ++i )
123
- NumBits += llvm::popcount (Bits[i] );
122
+ for (BitWord Bit : Bits )
123
+ NumBits += llvm::popcount (Bit );
124
124
return NumBits;
125
125
}
126
126
@@ -799,11 +799,8 @@ class SparseBitVector {
799
799
800
800
unsigned count () const {
801
801
unsigned BitCount = 0 ;
802
- for (ElementListConstIter Iter = Elements.begin ();
803
- Iter != Elements.end ();
804
- ++Iter)
805
- BitCount += Iter->count ();
806
-
802
+ for (const SparseBitVectorElement<ElementSize> &Elem : Elements)
803
+ BitCount += Elem.count ();
807
804
return BitCount;
808
805
}
809
806
You can’t perform that action at this time.
0 commit comments