Skip to main content

should_process

Function should_process 

Source
pub fn should_process(byte: u8, mask: u8) -> bool
Expand description

Fast check: could this byte possibly start a token?

This is a bloom-filter-style check using a bitwise OR mask of all first bytes of inserted patterns. False positives are expected and acceptable (they just trigger a match_at call that returns None). False negatives are impossible by construction (mask |= first_byte for every pattern).