Finds the first bit that matches the test value.
Returns the index of the first matching bit, or -1 if none found.
315 {
316
318 return -1;
319 }
320
321
324
325 for (fl::u32 block_idx = start_block; block_idx <
_block_count; ++block_idx) {
327
328
334 current_block &= mask;
335 }
336
337
338 if (!test_value) {
339 current_block = ~current_block;
340 }
341
342
343 if (block_idx == start_block && start_bit > 0) {
344 current_block &= ~static_cast<block_type>(((
block_type(1) << start_bit) - 1));
345 }
346
347
348 if (current_block != 0) {
349
350 fl::u32 bit_pos = static_cast<fl::u32>(__builtin_ctz(current_block));
352
353
354 if (absolute_pos <
_size) {
355 return static_cast<fl::i32>(absolute_pos);
356 }
357 }
358 }
359
360 return -1;
361 }
static constexpr fl::u32 bits_per_block
UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)