mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-07 11:06:58 +07:00
11 lines
333 B
Java
11 lines
333 B
Java
// "Replace the loop with 'Collection.removeIf'" "true"
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
public void removeEmpty(List<String> list) throws Exception {
|
|
// Copy to avoid CME
|
|
for<caret>(String item : list.toArray(new String[list.size()])) {
|
|
if(item.isEmpty()) list.remove(item);
|
|
}
|
|
}
|
|
} |