Skip to content

Commit 96f4970

Browse files
committed
[refactor] get rid of continue statements
1 parent a40f0dc commit 96f4970

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

exist-core/src/main/java/org/exist/xquery/functions/fn/FunSerialize.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,13 @@ public static Sequence normalize(final Expression callingExpr, final XQueryConte
153153
final ValueSequence step1 = new ValueSequence();
154154
for (final SequenceIterator i = input.iterate(); i.hasNext(); ) {
155155
final Item next = i.nextItem();
156-
if (next.getType() != Type.ARRAY) {
156+
if (next.getType() == Type.ARRAY) {
157+
final Sequence sequence = ArrayType.flatten(next);
158+
for (final SequenceIterator si = sequence.iterate(); si.hasNext(); ) {
159+
step1.add(si.nextItem());
160+
}
161+
} else {
157162
step1.add(next);
158-
continue;
159-
}
160-
final Sequence sequence = ArrayType.flatten(next);
161-
if (sequence.isEmpty()) {
162-
continue;
163-
}
164-
for (final SequenceIterator si = sequence.iterate(); si.hasNext(); ) {
165-
step1.add(si.nextItem());
166163
}
167164
}
168165

0 commit comments

Comments
 (0)