Skip to content

Commit 12bca20

Browse files
committed
auto merge of #9030 : tikue/rust/glob, r=huonw
2 parents f883159 + 39ce095 commit 12bca20

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/libextra/glob.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ impl Pattern {
304304
&& is_sep(prev_char.unwrap_or_default('/')))
305305
};
306306
307-
for ti in range(i, self.tokens.len()) {
308-
match self.tokens[ti] {
307+
for (ti, token) in self.tokens.slice_from(i).iter().enumerate() {
308+
match *token {
309309
AnySequence => {
310310
loop {
311-
match self.matches_from(prev_char, file, ti + 1, options) {
311+
match self.matches_from(prev_char, file, i + ti + 1, options) {
312312
SubPatternDoesntMatch => (), // keep trying
313313
m => return m,
314314
}
@@ -331,7 +331,7 @@ impl Pattern {
331331
}
332332
333333
let (c, next) = file.slice_shift_char();
334-
let matches = match self.tokens[ti] {
334+
let matches = match *token {
335335
AnyChar => {
336336
!require_literal(c)
337337
}

0 commit comments

Comments
 (0)