Skip to content

Commit 18a3921

Browse files
committed
Merge pull request #5 from DziNeIT/patch-1
Make LogicUtil#removeDuplicates more efficient
2 parents 42727a2 + 5a6f546 commit 18a3921

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/flowpowered/commons/LogicUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class LogicUtil {
3636
* @return the input collection
3737
*/
3838
public static <T extends Collection<?>> T removeDuplicates(T input) {
39-
List<Object> unique = new ArrayList<>();
39+
List<Object> unique = new ArrayList<>(input.size());
4040
for (Iterator<?> iter = input.iterator(); iter.hasNext(); ) {
4141
Object next = iter.next();
4242
if (unique.contains(next)) {

0 commit comments

Comments
 (0)