This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 651600bcad Trivial tweak: set initial capacity
651600bcad is described below

commit 651600bcad934c8cceed5af87df63944d313caab
Author: Daniel Sun <[email protected]>
AuthorDate: Sun Jan 12 02:50:52 2025 +0900

    Trivial tweak: set initial capacity
---
 .../org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java 
b/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java
index ffd574e383..95495bba55 100644
--- a/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java
+++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java
@@ -146,9 +146,9 @@ public final class ClosureMetaClass extends MetaClassImpl {
                 return 
MetaClassHelper.chooseMostGeneralMethodWith1NullParam(methods);
             } else {
                 final Object[] data = methods.getArray();
-                final int length = data.length;
-                List matchingMethods = new ArrayList(length);
-                for (int i = 0; i < length; i += 1) {
+                final int methodCount = methods.size();
+                List matchingMethods = new ArrayList(methodCount);
+                for (int i = 0; i < methodCount; i += 1) {
                     Object method = data[i];
 
                     // making this false helps find matches

Reply via email to