Commit 166e33d9 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

Precompile filter RegEx for get_file_list

parent d1d2cdbb
......@@ -103,7 +103,7 @@ class FileSystem(object):
def get_file_list(self, path, deep=False,
filter=None, reverse=False,
hide_hidden=True, encode_json=True):
filter = filter[:] or []
filter = map(re.compile, filter) or []
filelist = []
path_expand = self.expand(path)
try:
......@@ -115,7 +115,7 @@ class FileSystem(object):
# excluded by filters?
match = False
for filter_elem in filter:
if re.search(filter_elem, elem):
if filter_elem.search(elem):
match = True
if match != reverse:
continue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment