You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/04/15 00:04:26 UTC

[groovy] branch GROOVY-10035 updated: Trivial tweak

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

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


The following commit(s) were added to refs/heads/GROOVY-10035 by this push:
     new 1229c34  Trivial tweak
1229c34 is described below

commit 1229c343a692f97829c57a5f0ca0a7ff96beee8c
Author: Daniel Sun <su...@apache.org>
AuthorDate: Thu Apr 15 08:04:11 2021 +0800

    Trivial tweak
---
 src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java b/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java
index 73f6689..23476c4 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java
@@ -332,7 +332,8 @@ public class OperandStack {
 
         ClassNode top = stack.get(size - 1);
         targetType = targetType.redirect();
-        if (ClassNodeUtils.isCompatibleWith(top, targetType)) return;
+        if (top == targetType /* for better performance */
+                || ClassNodeUtils.isCompatibleWith(top, targetType)) return;
 
         if (coerce) {
             controller.getInvocationWriter().coerce(top, targetType);