Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X 39fc94256 -> c58023cd9


Reduce the initial capacity of resolved package set

(cherry picked from commit b5bffc908fee9bfb120fd4ef14c3820c05fec821)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/c58023cd
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/c58023cd
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/c58023cd

Branch: refs/heads/GROOVY_2_5_X
Commit: c58023cd9321b48d84a5d90ff24ff652dcfb1921
Parents: 39fc942
Author: Daniel Sun <sun...@apache.org>
Authored: Sat Aug 11 22:46:37 2018 +0800
Committer: Daniel Sun <sun...@apache.org>
Committed: Sat Aug 11 22:47:31 2018 +0800

----------------------------------------------------------------------
 src/main/java/org/codehaus/groovy/control/ResolveVisitor.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/c58023cd/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java 
b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
index 61661e3..30d847c 100644
--- a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
@@ -521,7 +521,7 @@ public class ResolveVisitor extends 
ClassCodeExpressionTransformer {
                 if (DEFAULT_IMPORTS == packagePrefixes) { // Only the 
non-cached type and packages should be cached
                     Set<String> packagePrefixSet = 
DEFAULT_IMPORT_CLASS_AND_PACKAGES_MAP.get(typeName);
                     if (null == packagePrefixSet) {
-                        packagePrefixSet = new HashSet<>();
+                        packagePrefixSet = new HashSet<>(2);
                         DEFAULT_IMPORT_CLASS_AND_PACKAGES_MAP.put(typeName, 
packagePrefixSet);
                     }
                     packagePrefixSet.add(packagePrefix);

Reply via email to