mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Index into array instead of removing matchers
This commit is contained in:
@@ -32,9 +32,10 @@ class PathMatcher
|
||||
@matchers.push(matcher[1]) for matcher in others
|
||||
|
||||
matches: (scopes) ->
|
||||
matcher = @matchers.shift()
|
||||
index = 0
|
||||
matcher = @matchers[index]
|
||||
for scope in scopes
|
||||
matcher = @matchers.shift() if matcher.matches(scope)
|
||||
matcher = @matchers[++index] if matcher.matches(scope)
|
||||
return true unless matcher?
|
||||
false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user