File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ use std:: cmp;
1112use std:: mem;
1213
1314use aho_corasick:: { Automaton , AcAutomaton , FullAcAutomaton } ;
@@ -682,13 +683,7 @@ impl BoyerMooreSearch {
682683 /// to beat the asm deep magic that is memchr. Unfortunately,
683684 /// I had trouble proving a useful turnover point. Hopefully,
684685 /// we can find one in the future.
685- fn should_use ( _pattern : & [ u8 ] ) -> bool {
686- // TBM is disabled until the bm_backstop_boundary unit test can pass
687- // and we're more confident that the implementation is correct.
688- //
689- // See: https://github.com/rust-lang/regex/issues/446
690- false
691- /*
686+ fn should_use ( pattern : & [ u8 ] ) -> bool {
692687 // The minimum pattern length required to use TBM.
693688 const MIN_LEN : usize = 9 ;
694689 // The minimum frequency rank (lower is rarer) that every byte in the
@@ -716,7 +711,6 @@ impl BoyerMooreSearch {
716711 pattern. len ( ) > MIN_LEN
717712 // all the bytes must be more common than the cutoff.
718713 && pattern. iter ( ) . all ( |c| freq_rank ( * c) >= cutoff)
719- */
720714 }
721715
722716 /// Check to see if there is a match at the given position
You can’t perform that action at this time.
0 commit comments