Skip to main content

has_no_earlier_match

Function has_no_earlier_match 

Source
pub(super) fn has_no_earlier_match(hirs: &[&Hir], suffix: &[u8]) -> bool
Expand description

Returns true when it’s impossible for an earlier match to be detected after a literal candidate (corresponding to suffix) has been found.

Specifically, that there is no earlier match than what a reverse scan of hirs after a match of suffix reports.

At present, this always returns false when hirs has any length except 1. That is, this optimization does not apply to multi-regex.