diff --git a/src/main/java/org/codehaus/groovy/util/ListHashMap.java b/src/main/java/org/codehaus/groovy/util/ListHashMap.java index 5063295ff91..15845ed5f05 100644 --- a/src/main/java/org/codehaus/groovy/util/ListHashMap.java +++ b/src/main/java/org/codehaus/groovy/util/ListHashMap.java @@ -20,6 +20,7 @@ import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -200,7 +201,7 @@ public int size() { } private Map toMap() { - Map m = new java.util.HashMap<>(); + Map m = new HashMap<>((int) (size / 0.75) + 1); for (int i = 0; i < size; i += 1) { m.put(keys[i], values[i]); }