File tree Expand file tree Collapse file tree
src/main/java/org/codehaus/groovy/classgen/asm/indy Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,23 +132,18 @@ private void visitReceiverOfMethodCall(final Expression receiver) {
132132 // Collect chain of simple method calls that can use indy optimization
133133 Deque <MethodCallExpression > chain = new ArrayDeque <>();
134134 Expression current = receiver ;
135- while ( current instanceof MethodCallExpression mce
135+ for (; current instanceof MethodCallExpression mce
136136 && !mce .isSpreadSafe () && !mce .isImplicitThis ()
137137 && !isSuperExpression (mce .getObjectExpression ())
138- && !isThisExpression (mce .getObjectExpression ())) {
138+ && !isThisExpression (mce .getObjectExpression ()); current = mce . getObjectExpression () ) {
139139 String name = getMethodName (mce .getMethod ());
140140 if (name == null || "call" .equals (name )) break ; // dynamic name or functional interface call
141141 chain .push (mce );
142- current = mce .getObjectExpression ();
143142 }
144143
145- if (chain .isEmpty ()) {
146- receiver .visit (controller .getAcg ());
147- return ;
148- }
149-
150- current .visit (controller .getAcg ());
151144 AsmClassGenerator acg = controller .getAcg ();
145+ current .visit (acg );
146+
152147 while (!chain .isEmpty ()) {
153148 MethodCallExpression call = chain .pop ();
154149 acg .onLineNumber (call , "visitMethodCallExpression: \" " + call .getMethod () + "\" :" );
You can’t perform that action at this time.
0 commit comments