You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/11/11 22:01:45 UTC

[GitHub] [lucene] rmuir commented on a diff in pull request #11923: enable error-prone "narrow calculation" check

rmuir commented on code in PR #11923:
URL: https://github.com/apache/lucene/pull/11923#discussion_r1020582937


##########
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));
+    bytesUsed.addAndGet(Integer.BYTES * (long) -ids.length);

Review Comment:
   yes we can improve these. i did a lot of the RAM usage stuff kinda mechanically, there was a fair amount of it. 



-- 
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-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org