Infinity loop with iterator fixed. #515

pull/520/head
Nikita 9 years ago
parent f8dfdb7154
commit 645b1240dc

@ -73,13 +73,19 @@ abstract class RedissonBaseIterator<V> implements Iterator<V> {
if (firstValues.isEmpty()) { if (firstValues.isEmpty()) {
firstValues = lastValues; firstValues = lastValues;
lastValues = null; lastValues = null;
if (firstValues.isEmpty() && tryAgain()) { if (firstValues.isEmpty()) {
if (tryAgain()) {
client = null; client = null;
firstValues = null; firstValues = null;
nextIterPos = 0; nextIterPos = 0;
prevIterPos = -1; prevIterPos = -1;
continue; continue;
} }
if (res.getPos() == 0) {
finished = true;
return false;
}
}
} else if (lastValues.removeAll(firstValues)) { } else if (lastValues.removeAll(firstValues)) {
currentElementRemoved = false; currentElementRemoved = false;
removeExecuted = false; removeExecuted = false;

Loading…
Cancel
Save