Skip to content

Commit 8e80fb9

Browse files
committed
optimize
1 parent 5e07bbb commit 8e80fb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xarray/core/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,10 @@ def _get_breaks_cached(
293293
# Determine the stop indices of the preferred chunks, but omit the last stop
294294
# (equal to the dim size). In particular, assume that when a sequence
295295
# expresses the preferred chunks, the sequence sums to the size.
296-
preferred_stops = set(
296+
preferred_stops = (
297297
range(preferred_chunk_sizes, size, preferred_chunk_sizes)
298298
if isinstance(preferred_chunk_sizes, int)
299-
else itertools.accumulate(preferred_chunk_sizes[:-1])
299+
else set(itertools.accumulate(preferred_chunk_sizes[:-1]))
300300
)
301301

302302
# Gather any stop indices of the specified chunks that are not a stop index

0 commit comments

Comments
 (0)