diff --git a/lucene/core/src/java/org/apache/lucene/index/SortedNumericDocValuesWriter.java b/lucene/core/src/java/org/apache/lucene/index/SortedNumericDocValuesWriter.java index 66a28374c3d..5d303118028 100644 --- a/lucene/core/src/java/org/apache/lucene/index/SortedNumericDocValuesWriter.java +++ b/lucene/core/src/java/org/apache/lucene/index/SortedNumericDocValuesWriter.java @@ -253,9 +253,6 @@ class SortedNumericDocValuesWriter extends DocValuesWriter 0) { numValues = Math.toIntExact(values.values.get(upto - 1)); - limit = upto + numValues; return true; - } else { - limit = upto; } return false; } @Override public long nextValue() { - if (upto == limit) { - throw new AssertionError(); - } else { - return values.values.get(upto++); - } + return values.values.get(upto++); } @Override