Skip to content

Commit 07dfb44

Browse files
committed
use iglob iterator
1 parent c9044da commit 07dfb44

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

mne_bids/path.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,12 +2487,8 @@ def _return_root_paths(root, datatype=None, ignore_json=True, ignore_nosub=False
24872487
if ignore_nosub:
24882488
search_str = "sub-*/" + search_str
24892489

2490-
paths = list(
2491-
map(
2492-
lambda fn: Path(root, fn),
2493-
glob.glob(search_str, root_dir=root, recursive=True),
2494-
)
2495-
)
2490+
paths = [ Path(root, fn) for fn in glob.iglob(search_str, root_dir=root, recursive=True) ]
2491+
24962492
# Only keep files (not directories), ...
24972493
# and omit the JSON sidecars if `ignore_json` is True.
24982494
if ignore_json:

0 commit comments

Comments
 (0)