Skip to content

Commit

Permalink
Use inplace reverse method. More efficient (#1537)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylion007 authored Mar 6, 2024
1 parent bc0482b commit 2fc795f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fsspec/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def _un_chain(path, kwargs):
bit = previous_bit
out.append((bit, protocol, kw))
previous_bit = bit
out = list(reversed(out))
out.reverse()
return out


Expand Down
2 changes: 1 addition & 1 deletion fsspec/implementations/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ def _dircache_from_items(self):
par0 = self._parent(par0)
subdirs.append(par0)

subdirs = subdirs[::-1]
subdirs.reverse()
for parent, child in zip(subdirs, subdirs[1:]):
# register newly discovered directories
assert child not in self.dircache
Expand Down

0 comments on commit 2fc795f

Please sign in to comment.