Skip to content

Commit 1d34249

Browse files
Use operator.itemgetter for perf/readability in archive (#1764)
Co-authored-by: Martin Durant <martin.durant@alumni.utoronto.ca>
1 parent 90c7cd9 commit 1d34249

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fsspec/archive.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import operator
2+
13
from fsspec import AbstractFileSystem
24
from fsspec.utils import tokenize
35

@@ -67,7 +69,7 @@ def ls(self, path, detail=True, **kwargs):
6769
out = {"name": ppath, "size": 0, "type": "directory"}
6870
paths[ppath] = out
6971
if detail:
70-
out = sorted(paths.values(), key=lambda _: _["name"])
72+
out = sorted(paths.values(), key=operator.itemgetter("name"))
7173
return out
7274
else:
7375
return sorted(paths)

0 commit comments

Comments
 (0)