ContainerUtil.filter: optimize for empty collections

This commit is contained in:
peter
2014-07-29 12:10:08 +02:00
parent cd5b53db93
commit a3fda205ed
@@ -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)) {