From 7b2e9b2a3a43f2b5bee37e44dd7b9e5be825145f Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:22:54 +0200 Subject: [PATCH] Improve some parentheses (#1386) --- fsspec/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fsspec/utils.py b/fsspec/utils.py index 9e52ffe51..991ce8d71 100644 --- a/fsspec/utils.py +++ b/fsspec/utils.py @@ -507,14 +507,14 @@ def merge_offset_ranges(paths, starts, ends, max_gap=0, max_block=None, sort=Tru starts = [s or 0 for s in starts] # Sort by paths and then ranges if `sort=True` if sort: - paths, starts, ends = [ + paths, starts, ends = ( list(v) for v in zip( *sorted( zip(paths, starts, ends), ) ) - ] + ) if paths: # Loop through the coupled `paths`, `starts`, and @@ -528,7 +528,7 @@ def merge_offset_ranges(paths, starts, ends, max_gap=0, max_block=None, sort=Tru elif ( paths[i] != paths[i - 1] or ((starts[i] - new_ends[-1]) > max_gap) - or ((max_block is not None and (ends[i] - new_starts[-1]) > max_block)) + or (max_block is not None and (ends[i] - new_starts[-1]) > max_block) ): # Cannot merge with previous block. # Add new `paths`, `starts`, and `ends` elements