From 2c933529f17fb9545901a696041a3711a1bd144a Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Mon, 23 Aug 2021 03:55:06 +0200 Subject: [PATCH] Fix infinite loop --- .../java/fr/pandacube/lib/core/util/IteratorIterator.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Core/src/main/java/fr/pandacube/lib/core/util/IteratorIterator.java b/Core/src/main/java/fr/pandacube/lib/core/util/IteratorIterator.java index b1cb99c..70a620e 100644 --- a/Core/src/main/java/fr/pandacube/lib/core/util/IteratorIterator.java +++ b/Core/src/main/java/fr/pandacube/lib/core/util/IteratorIterator.java @@ -41,11 +41,9 @@ public class IteratorIterator implements Iterator { } private void fixState() { fixCurrentIterator(); - while (currentIterator == null) { - if (iterators.hasNext()) { - currentIterator = iterators.next(); - fixCurrentIterator(); - } + while (currentIterator == null && iterators.hasNext()) { + currentIterator = iterators.next(); + fixCurrentIterator(); } }