diff --git a/hollow/src/main/java/com/netflix/hollow/core/write/HollowMapTypeWriteState.java b/hollow/src/main/java/com/netflix/hollow/core/write/HollowMapTypeWriteState.java index 8167d993c..2b94f63e1 100644 --- a/hollow/src/main/java/com/netflix/hollow/core/write/HollowMapTypeWriteState.java +++ b/hollow/src/main/java/com/netflix/hollow/core/write/HollowMapTypeWriteState.java @@ -185,7 +185,7 @@ private void calculateNumShards() { } long bitsPerKeyElement = 64 - Long.numberOfLeadingZeros(maxKeyOrdinal + 1); - long bitsPerValueElement = 64 - Long.numberOfLeadingZeros(maxValueOrdinal); + long bitsPerValueElement = maxValueOrdinal == 0 ? 1 : 64 - Long.numberOfLeadingZeros(maxValueOrdinal); long bitsPerMapSizeValue = 64 - Long.numberOfLeadingZeros(maxMapSize); long bitsPerMapPointer = 64 - Long.numberOfLeadingZeros(totalOfMapBuckets);