This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// time: [1.8843 µs 1.8897 µs 1.8955 µs] | |
pub fn original(input: &[u8]) -> Option<usize> { | |
let mut idx = 0; | |
'outer: while idx + 13 < input.len() { | |
let mut state = 0; | |
for (next_idx, byte) in input[idx..idx + 14].iter().enumerate().rev() { | |
let bit_idx = byte % 32; | |
if state & (1 << bit_idx) != 0 { | |
idx += next_idx + 1; | |
continue 'outer; |