Finds the first bit that matches the test value.
Returns the index of the first matching bit, or -1 if none found.
322 {
323
325 return -1;
326 }
327
328
331
332 for (fl::u32 block_idx = start_block; block_idx <
_block_count; ++block_idx) {
334
335
341 current_block &= mask;
342 }
343
344
345 if (!test_value) {
346 current_block = ~current_block;
347 }
348
349
350 if (block_idx == start_block && start_bit > 0) {
351 current_block &= ~static_cast<block_type>(((
block_type(1) << start_bit) - 1));
352 }
353
354
355 if (current_block != 0) {
356
357 fl::u32 bit_pos = static_cast<fl::u32>(__builtin_ctz(current_block));
359
360
361 if (absolute_pos <
_size) {
362 return static_cast<fl::i32>(absolute_pos);
363 }
364 }
365 }
366
367 return -1;
368 }
fl::unique_ptr< block_type[]> _blocks
static constexpr fl::u32 bits_per_block
fl::UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)