Infinity loop with iterator fixed. #515

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

@ -73,12 +73,18 @@ 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()) {
client = null; if (tryAgain()) {
firstValues = null; client = null;
nextIterPos = 0; firstValues = null;
prevIterPos = -1; nextIterPos = 0;
continue; prevIterPos = -1;
continue;
}
if (res.getPos() == 0) {
finished = true;
return false;
}
} }
} else if (lastValues.removeAll(firstValues)) { } else if (lastValues.removeAll(firstValues)) {
currentElementRemoved = false; currentElementRemoved = false;

Loading…
Cancel
Save