Skip to content

Commit

Permalink
Use len to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk committed Jun 12, 2024
1 parent 2592076 commit fadd876
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2990,7 +2990,7 @@ def isel(
dims.update(zip(var.dims, var.shape))
# Fastpath, skip all of this for variables with no dimensions
# Keep the result cached for future dictionary update
elif var_dims := var.dims:
elif len(var_dims := var.dims):
# Large datasets with alot of metadata may have many scalars
# without any relevant dimensions for slicing.
# Pick those out quickly and avoid paying the cost below
Expand Down

0 comments on commit fadd876

Please sign in to comment.