MCPcopy Create free account
hub / github.com/FastLED/FastLED / all

Function all

src/fl/stl/bitset_dynamic.h:280–300  ·  view source on GitHub ↗

Check if all bits are set

Source from the content-addressed store, hash-verified

278
279 // Check if all bits are set
280 bool all() const FL_NOEXCEPT {
281 if (_size == 0)
282 return true;
283
284 if (!_blocks) return false;
285
286 for (fl::u32 i = 0; i < _block_count - 1; ++i) {
287 if (_blocks[i] != static_cast<block_type>(~block_type(0)))
288 return false;
289 }
290
291 // Check last block with mask for valid bits
292 if (_block_count > 0) {
293 fl::u32 last_bit_pos = (_size - 1) % bits_per_block;
294 block_type mask =
295 static_cast<block_type>((static_cast<block_type>(1) << (last_bit_pos + 1)) - 1);
296 return (_blocks[_block_count - 1] & mask) == mask;
297 }
298
299 return true;
300 }
301
302 // Get the size of the bitset
303 FL_DISABLE_WARNING_PUSH

Callers 15

format_test_summaryFunction · 0.85
load_cacheFunction · 0.85
load_cacheFunction · 0.85
check_file_contentMethod · 0.85
_has_allowed_std_symbolFunction · 0.85
check_file_contentMethod · 0.85
diagnose_portFunction · 0.85

Calls

no outgoing calls

Tested by 5

load_cacheFunction · 0.68
mainFunction · 0.68