You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/04/12 00:41:00 UTC
[jira] [Resolved] (GROOVY-9078) Inefficiency in MethodNode and
ConstructorNode
[ https://issues.apache.org/jira/browse/GROOVY-9078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-9078.
-------------------------------
Resolution: Fixed
Assignee: Paul King
Fix Version/s: 2.4.17
2.5.7
3.0.0-beta-1
Code adjusted as suggested. Thanks!
> Inefficiency in MethodNode and ConstructorNode
> ----------------------------------------------
>
> Key: GROOVY-9078
> URL: https://issues.apache.org/jira/browse/GROOVY-9078
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Paul King
> Priority: Minor
> Fix For: 3.0.0-beta-1, 2.5.7, 2.4.17
>
>
> The constructor of {{MethodNode}} performs {{VariableScope scope = new VariableScope(); setVariableScope(scope);}} followed by {{setParameters(parameters);}}, which in turn creates a variable scope, populates it and sets it. The first variable scope is superflous and those 2 lines could be deleted.
> Also, the constructor of {{ConstructorNode}} calls the super constructor and then creates a variable scope, fills it with param info and sets it. Since the super constructor (as described above) already calls {{setParameters}}, the extra variable scope created in {{ConstructorNode}} could be removed.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)