From 5036286f8ca6f96c0f2d60b905343513e74e652a Mon Sep 17 00:00:00 2001 From: Caleb Hulbert Date: Tue, 5 Mar 2024 16:22:23 -0500 Subject: [PATCH] perf: don't call when reading attributes from a file --- .../org/janelia/saalfeldlab/n5/zarr/ZarrKeyValueReader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/janelia/saalfeldlab/n5/zarr/ZarrKeyValueReader.java b/src/main/java/org/janelia/saalfeldlab/n5/zarr/ZarrKeyValueReader.java index 3a1dfde..72ac52e 100644 --- a/src/main/java/org/janelia/saalfeldlab/n5/zarr/ZarrKeyValueReader.java +++ b/src/main/java/org/janelia/saalfeldlab/n5/zarr/ZarrKeyValueReader.java @@ -600,7 +600,8 @@ public JsonElement getAttributesFromContainer( final String normalResourcePath) throws N5Exception { final String absolutePath = keyValueAccess.compose(uri, normalResourceParent, normalResourcePath); - if (!keyValueAccess.exists(absolutePath)) + + if (!keyValueAccess.isFile(absolutePath)) return null; try (final LockedChannel lockedChannel = keyValueAccess.lockForReading(absolutePath)) {