Skip to content

Commit

Permalink
in BytesRefHash constructor avoid duplicate BytesStartArray.bytesUsed…
Browse files Browse the repository at this point in the history
…() call (apache#13032)
  • Loading branch information
cpoerschke authored Feb 8, 2024
1 parent e5bceb4 commit bff5ac0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public BytesRefHash(ByteBlockPool pool, int capacity, BytesStartArray bytesStart
Arrays.fill(ids, -1);
this.bytesStartArray = bytesStartArray;
bytesStart = bytesStartArray.init();
bytesUsed =
bytesStartArray.bytesUsed() == null ? Counter.newCounter() : bytesStartArray.bytesUsed();
final Counter bytesUsed = bytesStartArray.bytesUsed();
this.bytesUsed = bytesUsed == null ? Counter.newCounter() : bytesUsed;
bytesUsed.addAndGet(hashSize * (long) Integer.BYTES);
}

Expand Down

0 comments on commit bff5ac0

Please sign in to comment.