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/10/10 02:12:14 UTC

[groovy] branch danielsun/refactor-tailrec created (now 3588b85)

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

sunlan pushed a change to branch danielsun/refactor-tailrec
in repository https://gitbox.apache.org/repos/asf/groovy.git.


      at 3588b85  Trivial refactoring: remove redundant code

This branch includes the following new commits:

     new 3588b85  Trivial refactoring: remove redundant code

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[groovy] 01/01: Trivial refactoring: remove redundant code

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3588b8567dc635c02481d050320aefe570781b02
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Oct 10 10:11:59 2021 +0800

    Trivial refactoring: remove redundant code
---
 .../codehaus/groovy/transform/tailrec/StatementReplacer.java | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/transform/tailrec/StatementReplacer.java b/src/main/java/org/codehaus/groovy/transform/tailrec/StatementReplacer.java
index 942baff..9b2f39a 100644
--- a/src/main/java/org/codehaus/groovy/transform/tailrec/StatementReplacer.java
+++ b/src/main/java/org/codehaus/groovy/transform/tailrec/StatementReplacer.java
@@ -160,15 +160,7 @@ class StatementReplacer extends CodeVisitorSupport {
         this.closureLevel = closureLevel;
     }
 
-    private Closure<Boolean> when = new Closure<Boolean>(this, this) {
-        public Boolean doCall(Statement node) {
-            return false;
-        }
-    };
-    private Closure<Statement> replaceWith = new Closure<Statement>(this, this) {
-        public Statement doCall(Statement statement) {
-            return statement;
-        }
-    };
+    private Closure<Boolean> when;
+    private Closure<Statement> replaceWith;
     private int closureLevel = 0;
 }