Skip to content

Commit 337d417

Browse files
authored
Merge pull request #93 from brmmm3/move_tokens_len
Move tokens_len into if block as it is only used there
2 parents cf3959a + bf155d4 commit 337d417

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,12 @@ impl Pattern {
595595
});
596596
};
597597

598-
let tokens_len = tokens.len();
599-
600598
if is_valid {
601599
// collapse consecutive AnyRecursiveSequence to a
602600
// single one
601+
602+
let tokens_len = tokens.len();
603+
603604
if !(tokens_len > 1 && tokens[tokens_len - 1] == AnyRecursiveSequence) {
604605
is_recursive = true;
605606
tokens.push(AnyRecursiveSequence);

0 commit comments

Comments
 (0)