Skip to content

Commit bf2b672

Browse files
authored
Use reversed to iterate through list backwards (#374)
As using slicing syntax on `list`s makes a copy, use `reversed` instead to avoid the copy and just create a generator for iterating through the `list` backwards.
1 parent 2c1a6e0 commit bf2b672

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zarr/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ def _decode_chunk(self, cdata):
17351735

17361736
# apply filters
17371737
if self._filters:
1738-
for f in self._filters[::-1]:
1738+
for f in reversed(self._filters):
17391739
chunk = f.decode(chunk)
17401740

17411741
# view as numpy array with correct dtype

0 commit comments

Comments
 (0)