Skip to content

Commit

Permalink
Single startswith() call instead of multiple ones
Browse files Browse the repository at this point in the history
It's faster and probably more readable.
  • Loading branch information
DimitriPapadopoulos committed Oct 31, 2023
1 parent 71ce63a commit b0ef6c3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions zarr/_storage/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,8 @@ def _validate_key(self, key: str):
)

if (
not key.startswith("data/")
and (not key.startswith("meta/"))
and (not key == "zarr.json")
not key.startswith(("data/", "meta/"))
and key != "zarr.json"
# TODO: Possibly allow key == ".zmetadata" too if we write a
# consolidated metadata spec corresponding to this?
):
Expand Down

0 comments on commit b0ef6c3

Please sign in to comment.