Finds the first run of consecutive bits that match the test value. Returns the index of the first bit in the run, or -1 if no run found. @param test_value The value to search for (true or false) @param min_length Minimum length of the run (default: 1) @param offset Starting position to search from (default: 0)
| 287 | /// @param min_length Minimum length of the run (default: 1) |
| 288 | /// @param offset Starting position to search from (default: 0) |
| 289 | fl::i32 find_run(bool test_value, fl::u32 min_length, fl::u32 offset = 0) const FL_NOEXCEPT { |
| 290 | fl::u32 run_start = offset; |
| 291 | fl::u32 run_length = 0; |
| 292 | |
| 293 | for (fl::u32 i = offset; i < N && run_length < min_length; ++i) { |
| 294 | bool current_bit = test(i); |
| 295 | if (current_bit != test_value) { |
| 296 | run_length = 0; |
| 297 | if (i + 1 < N) { |
| 298 | run_start = i + 1; |
| 299 | } |
| 300 | } else { |
| 301 | ++run_length; |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | if (run_length >= min_length) { |
| 306 | return static_cast<fl::i32>(run_start); |
| 307 | } |
| 308 | |
| 309 | return -1; // No run found |
| 310 | } |
| 311 | |
| 312 | /// Equality comparison |
| 313 | bool operator==(const bitset_fixed &other) const FL_NOEXCEPT { |
no outgoing calls
no test coverage detected