Skip to content

Commit

Permalink
make skipping ignored files O(n)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhvng committed Apr 11, 2023
1 parent 63ffd36 commit b4ec91e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion open_musiclm/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ def __init__(
files = []
ignore_files = default(ignore_files, [])
num_ignored = 0
ignore_file_set = set([f.split('/')[-1] for f in ignore_files])
for ext in exts:
for file in path.glob(f'**/*.{ext}'):
if any(ignore_file in str(file) for ignore_file in ignore_files):
if file.name in ignore_file_set:
num_ignored += 1
continue
else:
Expand Down

0 comments on commit b4ec91e

Please sign in to comment.