Returns true if the program is amenable to suffix scanning. When this is true, as a heuristic, we assume it is OK to quickly scan for suffix literals and then do a *reverse* DFA match from any matches produced by the literal scan. (And then followed by a forward DFA search, since the previously found suffix literal maybe not actually be the end of a match.) This is a bit of a specialized optimiz
(&self)
| 1275 | /// strings are generally rarer, so we only enable this optimization when |
| 1276 | /// we have a meaty suffix. |
| 1277 | fn should_suffix_scan(&self) -> bool { |
| 1278 | if self.suffixes.is_empty() { |
| 1279 | return false; |
| 1280 | } |
| 1281 | let lcs_len = self.suffixes.lcs().char_len(); |
| 1282 | lcs_len >= 3 && lcs_len > self.dfa.prefixes.lcp().char_len() |
| 1283 | } |
| 1284 | } |
| 1285 | |
| 1286 | #[derive(Clone, Copy, Debug)] |
no test coverage detected