Apache Lucene open-source search software
Simplify FSTCompiler loop (#13663)
mrhbj29eda04e2332
diff --git a/lucene/core/src/java/org/apache/lucene/util/fst/FSTCompiler.java b/lucene/core/src/java/org/apache/lucene/util/fst/FSTCompiler.javaindex e837b7775e0..8fb194b4425 100644--- a/lucene/core/src/java/org/apache/lucene/util/fst/FSTCompiler.java+++ b/lucene/core/src/java/org/apache/lucene/util/fst/FSTCompiler.java@@ -871,10 +871,7 @@ public class FSTCompiler<T> {int pos1 = 0;int pos2 = input.offset;final int pos1Stop = Math.min(lastInput.length(), input.length);- while (true) {- if (pos1 >= pos1Stop || lastInput.intAt(pos1) != input.ints[pos2]) {- break;- }+ while (pos1 < pos1Stop && lastInput.intAt(pos1) == input.ints[pos2]) {pos1++;pos2++;}