Apache Lucene open-source search software
LUCENE-7053: Simplify code to work around Java 8u25 compiler bug
Uwe Schindler3c27980c4ae7
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.javaindex 888882a0e9f..d0b92476e9f 100644--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java@@ -74,12 +74,7 @@ public class TSTLookup extends Lookup {final byte[] bBytes = b.bytes;int bUpto = b.offset;- final int aStop;- if (a.length < b.length) {- aStop = aUpto + a.length;- } else {- aStop = aUpto + b.length;- }+ final int aStop = aUpto + Math.min(a.length, b.length);while(aUpto < aStop) {int aByte = aBytes[aUpto++] & 0xff;