Skip to content

Commit 960e601

Browse files
committed
Same construct above as well
1 parent 793fdf9 commit 960e601

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

rewrite-core/src/main/java/org/openrewrite/internal/ListUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,7 @@ public static <T> List<T> insert(@Nullable List<T> ls, @Nullable T t, int index)
215215
}
216216

217217
if (newLs != ls && nullEncountered) {
218-
//noinspection StatementWithEmptyBody
219-
while (newLs.remove(null)) ;
218+
newLs.removeIf(Objects::isNull);
220219
}
221220

222221
//noinspection NullableProblems

0 commit comments

Comments
 (0)