File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed
Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -47,15 +47,9 @@ impl FuzzyPatternCounter {
4747 let mut searcher = Searcher :: new_fwd ( ) ;
4848
4949 // encode the patterns for each collection/searcher combination
50- let enc_pat1 = pat1
51- . has_patterns ( )
52- . then ( || searcher_1. encode_patterns ( & pat1. bytes ( ) ) ) ;
53- let enc_pat2 = pat2
54- . has_patterns ( )
55- . then ( || searcher_2. encode_patterns ( & pat2. bytes ( ) ) ) ;
56- let enc_pat = pat
57- . has_patterns ( )
58- . then ( || searcher. encode_patterns ( & pat. bytes ( ) ) ) ;
50+ let enc_pat1 = ( !pat1. is_empty ( ) ) . then ( || searcher_1. encode_patterns ( & pat1. bytes ( ) ) ) ;
51+ let enc_pat2 = ( !pat2. is_empty ( ) ) . then ( || searcher_2. encode_patterns ( & pat2. bytes ( ) ) ) ;
52+ let enc_pat = ( !pat. is_empty ( ) ) . then ( || searcher. encode_patterns ( & pat. bytes ( ) ) ) ;
5953
6054 let bits1 = FixedBitSet :: with_capacity ( pat1. len ( ) ) ;
6155 let bits2 = FixedBitSet :: with_capacity ( pat2. len ( ) ) ;
Original file line number Diff line number Diff line change @@ -47,10 +47,6 @@ impl PatternCollection {
4747 self . 0 . is_empty ( )
4848 }
4949
50- pub fn has_patterns ( & self ) -> bool {
51- !self . is_empty ( )
52- }
53-
5450 pub fn iter ( & self ) -> std:: slice:: Iter < ' _ , Pattern > {
5551 self . 0 . iter ( )
5652 }
You can’t perform that action at this time.
0 commit comments