(index-prio) Don't increment readItems counter when the output buffer is full

This behavior was causing the reader to sometimes discard trailing entries in the list.
This commit is contained in:
Viktor Lofgren 2024-07-11 19:21:36 +02:00
parent 1ab875a75d
commit 97695693f2

View File

@ -68,7 +68,7 @@ public class PrioIndexEntrySource implements EntrySource {
var outputBuffer = buffer.asByteBuffer().order(ByteOrder.LITTLE_ENDIAN);
outputBuffer.clear();
while (readItems++ < numItems && outputBuffer.hasRemaining()) {
while (outputBuffer.hasRemaining() && readItems++ < numItems) {
fillReadBuffer();
int rank;