uschindler commented on code in PR #11923: URL: https://github.com/apache/lucene/pull/11923#discussion_r1020891869
########## lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java: ########## @@ -414,7 +414,7 @@ private void rehash(final int newSize, boolean hashOnData) { } hashMask = newMask; - bytesUsed.addAndGet(Integer.BYTES * (-ids.length)); Review Comment: This is always a bit hard to read. Mabye we should add a method `Counter#subtractAndGet` in our counter class? I think this might be a separate issue, but might worth to do it. An alternative to this line: In most cases in this issue you applied the cast to "constants" (because then the javac compiler can do the inlining directly (you know, javac inlines static final integer and String literals). So maybe have it here like `(long) Integer.BYTES * (-ids.length)`. Sorry for bringing this specific place up again. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org