Fix error in resizing

This commit is contained in:
mcrcortex
2024-12-24 12:56:05 +10:00
parent 412768c57e
commit 663a352586

View File

@@ -57,7 +57,7 @@ public final class NodeStore {
//Ensures that index is within the array, if not, resizes to contain it + buffer zone //Ensures that index is within the array, if not, resizes to contain it + buffer zone
private void ensureSized(int index) { private void ensureSized(int index) {
if (index*LONGS_PER_NODE > this.localNodeData.length) { if (index*LONGS_PER_NODE >= this.localNodeData.length) {
int newSize = Math.min((index+INCREMENT_SIZE), this.allocationSet.getLimit()); int newSize = Math.min((index+INCREMENT_SIZE), this.allocationSet.getLimit());
long[] newStore = new long[newSize * LONGS_PER_NODE]; long[] newStore = new long[newSize * LONGS_PER_NODE];