You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/04/14 20:14:00 UTC

[jira] [Commented] (GROOVY-10035) Eliminate redundant type cast

    [ https://issues.apache.org/jira/browse/GROOVY-10035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17321295#comment-17321295 ] 

Eric Milles commented on GROOVY-10035:
--------------------------------------

The proposal above does indeed appear simpler, but it hides the fact that ClassNodeUtils.isCompatibleWith does not exist and contains more code than is being replaced.

> Eliminate redundant type cast
> -----------------------------
>
>                 Key: GROOVY-10035
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10035
>             Project: Groovy
>          Issue Type: Improvement
>          Components: bytecode
>            Reporter: Eric Milles
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The ticket is to provide some suggestion to tweak the fix of GROOVY-10034 ( [https://github.com/apache/groovy/pull/1556] ):
> It seems that we could make the check simpler, we do not add extra checks but tweak the existing check.
> h3. *Current*
> [https://github.com/apache/groovy/blob/master/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java#L334]
> {code:java}
>         if (targetType == top) return;
> {code}
> h3. *Proposed*
> [https://github.com/apache/groovy/pull/1561]
> {code:java}
> if (ClassNodeUtils.isCompatibleWith(top, targetType)) return;
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)