diff --git a/flox/core.py b/flox/core.py index 48b5932d..d57bbbf6 100644 --- a/flox/core.py +++ b/flox/core.py @@ -514,7 +514,7 @@ def invert(x) -> tuple[np.ndarray, ...]: ] cohort_ = present_labels[cohidx] cohort = [elem.item() for elem in cohort_ if elem not in merged_keys] - if len(cohort) == 0: + if not cohort: continue merged_keys.update(cohort) allchunks = (label_chunks[member].tolist() for member in cohort)