Skip to content

Commit e0e96c4

Browse files
polyglot-ksbrannen
authored andcommitted
Simplify implementation of FilteredIterator
Closes gh-33902
1 parent bb32df0 commit e0e96c4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

spring-core/src/main/java/org/springframework/util/FilteredIterator.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,13 @@ public boolean hasNext() {
5555
if (this.nextSet) {
5656
return true;
5757
}
58-
else {
59-
return setNext();
60-
}
58+
return setNext();
6159
}
6260

6361
@Override
6462
public E next() {
65-
if (!this.nextSet) {
66-
if (!setNext()) {
63+
if (!this.nextSet && !setNext()) {
6764
throw new NoSuchElementException();
68-
}
6965
}
7066
this.nextSet = false;
7167
Assert.state(this.next != null, "Next should not be null");

0 commit comments

Comments
 (0)