corrected -> return (int) (sizeInBytes / chunkSize) + 1;

This commit is contained in:
Rob Austin
2018-11-15 21:27:46 +00:00
parent 9a02d8e250
commit 075083455e
@@ -420,8 +420,7 @@ public abstract class VanillaChronicleHash<K,
}
}
public final void createInMemoryStoreAndSegments(ChronicleHashResources resources)
throws IOException {
public final void createInMemoryStoreAndSegments(ChronicleHashResources resources) {
this.resources = resources;
BytesStore bytesStore = nativeBytesStoreWithFixedCapacity(sizeInBytesWithoutTiers());
createStoreAndSegments(bytesStore);
@@ -709,8 +708,8 @@ public abstract class VanillaChronicleHash<K,
// int division is MUCH faster than long on Intel CPUs
if (sizeInBytes <= Integer.MAX_VALUE)
return (((int) sizeInBytes) / (int) chunkSize) + 2;
return (int) (sizeInBytes / chunkSize) + 2;
return (((int) sizeInBytes) / (int) chunkSize) + 1;
return (int) (sizeInBytes / chunkSize) + 1;
}
public final int size() {