diff --git a/src/main/java/de/danielbechler/util/Collections.java b/src/main/java/de/danielbechler/util/Collections.java index b34666fe..b1141962 100644 --- a/src/main/java/de/danielbechler/util/Collections.java +++ b/src/main/java/de/danielbechler/util/Collections.java @@ -88,18 +88,20 @@ public static int indexOf(final Iterable haystack, final T need public static Collection filteredCopyOf(final Collection source, final Collection filter) { + // Patched : Replaces collection and arrayList by HashSet to improve the removeAll performance using the + // implementation of contains() of the hashset final Collection copy; if (source != null) { - copy = new LinkedList(source); + copy = new HashSet(source); } else { - copy = new LinkedList(); + copy = new HashSet(); } if (filter != null) { - copy.removeAll(new ArrayList(filter)); + copy.removeAll(new HashSet(filter)); } return copy; }