mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ContainerUtil.filter: optimize for empty collections
This commit is contained in:
@@ -828,6 +828,7 @@ public class ContainerUtil extends ContainerUtilRt {
|
||||
|
||||
@NotNull
|
||||
public static <T> List<T> findAll(@NotNull Collection<? extends T> collection, @NotNull Condition<? super T> condition) {
|
||||
if (collection.isEmpty()) return emptyList();
|
||||
final List<T> result = new SmartList<T>();
|
||||
for (final T t : collection) {
|
||||
if (condition.value(t)) {
|
||||
|
||||
Reference in New Issue
Block a user