Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit b684bdb

Browse files
committed
Fix #81
1 parent 57991a4 commit b684bdb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

root_pandas/readwrite.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ def get_nonscalar_columns(array):
9595
def get_matching_variables(branches, patterns, fail=True):
9696
# Convert branches to a set to make x "in branches" O(1) on average
9797
branches = set(branches)
98-
patterns = set(patterns)
9998
# Find any trivial matches
100-
selected = list(branches.intersection(patterns))
99+
selected = sorted(branches.intersection(patterns),
100+
key=lambda s: patterns.index(s))
101101
# Any matches that weren't trivial need to be looped over...
102-
for pattern in patterns.difference(selected):
102+
for pattern in set(patterns).difference(selected):
103103
found = False
104104
# Avoid using fnmatch if the pattern if possible
105105
if re.findall(r'(\*)|(\?)|(\[.*\])|(\[\!.*\])', pattern):

0 commit comments

Comments
 (0)