mikemccand commented on a change in pull request #2138:
URL: https://github.com/apache/lucene-solr/pull/2138#discussion_r542413369



##########
File path: 
lucene/sandbox/src/java/org/apache/lucene/sandbox/search/MultiNormsLeafSimScorer.java
##########
@@ -128,7 +128,7 @@ public boolean advanceExact(int target) throws IOException {
       for (int i = 0; i < normsArr.length; i++) {
         boolean found = normsArr[i].advanceExact(target);
         assert found;
-        normValue += weightArr[i] * LENGTH_TABLE[(byte) 
normsArr[i].longValue()];
+        normValue += weightArr[i] * LENGTH_TABLE[(byte) 
normsArr[i].longValue() & 0xff];

Review comment:
       Actually, I see that `SimilarityBase.java` uses `Byte.toUnsignedInt` 
instead -- should we use that here?  It is the same computation?
   
   Or, if you want to stick with `& 0xff`, could you add parens around the 
`(byte)` cast to make the order of operations clear?




----------------------------------------------------------------
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.

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

Reply via email to