Skip to content

Commit

Permalink
iter
Browse files Browse the repository at this point in the history
  • Loading branch information
iverase committed Oct 16, 2024
1 parent eaba952 commit 9a4d96a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public BytesRefHash(long capacity, float maxLoadFactor, BigArrays bigArrays) {
boolean success = false;
try {
// `super` allocates a big array so we have to `close` if we fail here or we'll leak it.
this.hashes = bigArrays.newIntArray(capacity, false);
this.hashes = bigArrays.newIntArray(maxSize, false);
this.bytesRefs = new BytesRefArray(capacity, bigArrays);
success = true;
} finally {
Expand Down Expand Up @@ -98,7 +98,7 @@ public BytesRefHash(BytesRefArray bytesRefs, float maxLoadFactor, BigArrays bigA
boolean success = false;
try {
// `super` allocates a big array so we have to `close` if we fail here or we'll leak it.
this.hashes = bigArrays.newIntArray(bytesRefs.size() + 1, false);
this.hashes = bigArrays.newIntArray(maxSize, false);
this.bytesRefs = BytesRefArray.takeOwnershipOf(bytesRefs);
success = true;
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public LongHash(long capacity, float maxLoadFactor, BigArrays bigArrays) {
super(capacity, maxLoadFactor, bigArrays);
try {
// `super` allocates a big array so we have to `close` if we fail here or we'll leak it.
keys = bigArrays.newLongArray(capacity, false);
keys = bigArrays.newLongArray(maxSize, false);
} finally {
if (keys == null) {
close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public LongLongHash(long capacity, float maxLoadFactor, BigArrays bigArrays) {
super(capacity, maxLoadFactor, bigArrays);
try {
// `super` allocates a big array so we have to `close` if we fail here or we'll leak it.
keys = bigArrays.newLongArray(2 * capacity, false);
keys = bigArrays.newLongArray(2 * maxSize, false);
} finally {
if (keys == null) {
close();
Expand Down

0 comments on commit 9a4d96a

Please sign in to comment.