File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/java/org/codehaus/groovy/reflection Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -173,9 +173,8 @@ public Collection<ClassInfo> initValue() {
173173
174174 @ Override
175175 public Set <CachedClass > initValue () {
176- Set <CachedClass > res = new HashSet <>(0 );
177-
178176 Class [] classes = getTheClass ().getInterfaces ();
177+ Set <CachedClass > res = new HashSet <>(classes .length );
179178 for (Class cls : classes ) {
180179 res .add (ReflectionCache .getCachedClass (cls ));
181180 }
@@ -188,12 +187,13 @@ public Set<CachedClass> initValue() {
188187
189188 @ Override
190189 public Set <CachedClass > initValue () {
191- Set <CachedClass > res = new HashSet <>(0 );
192-
193- if (getTheClass ().isInterface ()) {
190+ Class <?> theClass = getTheClass ();
191+ Class [] classes = theClass .getInterfaces ();
192+ Set <CachedClass > res = new HashSet <>(classes .length + 8 );
193+ if (theClass .isInterface ()) {
194194 res .add (CachedClass .this );
195195 }
196- Class [] classes = getTheClass (). getInterfaces ();
196+
197197 for (Class cls : classes ) {
198198 CachedClass aClass = ReflectionCache .getCachedClass (cls );
199199 if (!res .contains (aClass ))
You can’t perform that action at this time.
0 commit comments