Skip to content

Commit

Permalink
use enumerate in place of 'for ti in range(i, tokens.len()) ... match…
Browse files Browse the repository at this point in the history
… tokens[ti] ...'
  • Loading branch information
Tim Kuehn committed Sep 7, 2013
1 parent f883159 commit 39ce095
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libextra/glob.rs
Expand Up @@ -304,11 +304,11 @@ impl Pattern {
&& is_sep(prev_char.unwrap_or_default('/')))
};
for ti in range(i, self.tokens.len()) {
match self.tokens[ti] {
for (ti, token) in self.tokens.slice_from(i).iter().enumerate() {
match *token {
AnySequence => {
loop {
match self.matches_from(prev_char, file, ti + 1, options) {
match self.matches_from(prev_char, file, i + ti + 1, options) {
SubPatternDoesntMatch => (), // keep trying
m => return m,
}
Expand All @@ -331,7 +331,7 @@ impl Pattern {
}
let (c, next) = file.slice_shift_char();
let matches = match self.tokens[ti] {
let matches = match *token {
AnyChar => {
!require_literal(c)
}
Expand Down

5 comments on commit 39ce095

@bors
Copy link
Contributor

@bors bors commented on 39ce095 Sep 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from huonw
at tikue@39ce095

@bors
Copy link
Contributor

@bors bors commented on 39ce095 Sep 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging tikue/rust/glob = 39ce095 into auto

@bors
Copy link
Contributor

@bors bors commented on 39ce095 Sep 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tikue/rust/glob = 39ce095 merged ok, testing candidate = 12bca20

@bors
Copy link
Contributor

@bors bors commented on 39ce095 Sep 7, 2013

@bors
Copy link
Contributor

@bors bors commented on 39ce095 Sep 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 12bca20

Please sign in to comment.