File tree 1 file changed +9
-12
lines changed
1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -678,18 +678,15 @@ struct TwoWaySearcher {
678
678
*/
679
679
impl TwoWaySearcher {
680
680
fn new ( needle : & [ u8 ] ) -> TwoWaySearcher {
681
- let ( crit_pos1, period1) = TwoWaySearcher :: maximal_suffix ( needle, false ) ;
682
- let ( crit_pos2, period2) = TwoWaySearcher :: maximal_suffix ( needle, true ) ;
683
-
684
- let crit_pos;
685
- let period;
686
- if crit_pos1 > crit_pos2 {
687
- crit_pos = crit_pos1;
688
- period = period1;
689
- } else {
690
- crit_pos = crit_pos2;
691
- period = period2;
692
- }
681
+ let ( crit_pos_false, period_false) = TwoWaySearcher :: maximal_suffix ( needle, false ) ;
682
+ let ( crit_pos_true, period_true) = TwoWaySearcher :: maximal_suffix ( needle, true ) ;
683
+
684
+ let ( crit_pos, period) =
685
+ if crit_pos_false > crit_pos_true {
686
+ ( crit_pos_false, period_false)
687
+ } else {
688
+ ( crit_pos_true, period_true)
689
+ } ;
693
690
694
691
// This isn't in the original algorithm, as far as I'm aware.
695
692
let byteset = needle. iter ( )
You can’t perform that action at this time.
0 commit comments