FastLED 3.9.15
Loading...
Searching...
No Matches

◆ count()

uint32_t fl::bitset_dynamic::count ( ) const
inlinenoexcept

Definition at line 219 of file bitset_dynamic.h.

219 {
220 uint32_t result = 0;
221 for (uint32_t i = 0; i < _block_count; ++i) {
222 block_type v = _blocks[i];
223 // Brian Kernighan's algorithm for counting bits
224 while (v) {
225 v &= (v - 1);
226 ++result;
227 }
228 }
229 return result;
230 }
block_type * _blocks

References _block_count, and _blocks.