File tree 1 file changed +2
-8
lines changed
1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ use std:: cmp;
11
12
use std:: mem;
12
13
13
14
use aho_corasick:: { Automaton , AcAutomaton , FullAcAutomaton } ;
@@ -682,13 +683,7 @@ impl BoyerMooreSearch {
682
683
/// to beat the asm deep magic that is memchr. Unfortunately,
683
684
/// I had trouble proving a useful turnover point. Hopefully,
684
685
/// 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 {
692
687
// The minimum pattern length required to use TBM.
693
688
const MIN_LEN : usize = 9 ;
694
689
// The minimum frequency rank (lower is rarer) that every byte in the
@@ -716,7 +711,6 @@ impl BoyerMooreSearch {
716
711
pattern. len ( ) > MIN_LEN
717
712
// all the bytes must be more common than the cutoff.
718
713
&& pattern. iter ( ) . all ( |c| freq_rank ( * c) >= cutoff)
719
- */
720
714
}
721
715
722
716
/// Check to see if there is a match at the given position
You can’t perform that action at this time.
0 commit comments