Skip to content

Commit 5fd7358

Browse files
committed
Skip empty maps when iterating over entries of LayeredImageHeapMap
1 parent db0006f commit 5fd7358

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/util/LayeredImageHeapMap.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,12 @@ public void remove() {
193193
public boolean advance() {
194194
boolean advance = current.advance();
195195
if (!advance) {
196-
if (cursors.hasNext()) {
196+
while (cursors.hasNext()) {
197197
current = cursors.next();
198-
if (keys.add(current.getKey())) {
199-
return true;
198+
while (current.advance()) {
199+
if (keys.add(current.getKey())) {
200+
return true;
201+
}
200202
}
201203
}
202204
}

0 commit comments

Comments
 (0)