Skip to content

Commit

Permalink
Merge pull request #93 from brmmm3/move_tokens_len
Browse files Browse the repository at this point in the history
Move tokens_len into if block as it is only used there
  • Loading branch information
KodrAus committed Jan 8, 2021
2 parents cf3959a + bf155d4 commit 337d417
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Expand Up @@ -595,11 +595,12 @@ impl Pattern {
});
};

let tokens_len = tokens.len();

if is_valid {
// collapse consecutive AnyRecursiveSequence to a
// single one

let tokens_len = tokens.len();

if !(tokens_len > 1 && tokens[tokens_len - 1] == AnyRecursiveSequence) {
is_recursive = true;
tokens.push(AnyRecursiveSequence);
Expand Down

0 comments on commit 337d417

Please sign in to comment.