freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [19/23] incubator-freemarker git commit: Decreased macro call stack usage by 1.
Date Tue, 15 Dec 2015 23:26:24 GMT
Decreased macro call stack usage by 1.


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/bc303ab9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/bc303ab9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/bc303ab9

Branch: refs/heads/master
Commit: bc303ab9b42aa02cb94419dcff719fdc2d64160e
Parents: 77d44df
Author: ddekany <ddekany@apache.org>
Authored: Mon Dec 14 23:49:09 2015 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Mon Dec 14 23:51:00 2015 +0100

----------------------------------------------------------------------
 src/main/java/freemarker/core/Environment.java | 5 +++--
 src/main/java/freemarker/core/Macro.java       | 6 ------
 2 files changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/bc303ab9/src/main/java/freemarker/core/Environment.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/Environment.java b/src/main/java/freemarker/core/Environment.java
index 004012e..a622e9b 100644
--- a/src/main/java/freemarker/core/Environment.java
+++ b/src/main/java/freemarker/core/Environment.java
@@ -344,7 +344,7 @@ public final class Environment extends Configurable {
      * 
      * @since 2.3.24
      */
-    void visit(TemplateElement[] elementBuffer) throws IOException, TemplateException {
+    final void visit(TemplateElement[] elementBuffer) throws IOException, TemplateException
{
         if (elementBuffer == null) {
             return;
         }
@@ -689,7 +689,8 @@ public final class Environment extends Configurable {
             currentNamespace = (Namespace) macroToNamespaceLookup.get(macro);
 
             try {
-                macroCtx.runMacro(this);
+                macroCtx.sanityCheck(this);
+                visit(macro.getChildBuffer());
             } catch (ReturnInstruction.Return re) {
                 // Not an error, just a <#return>
             } catch (TemplateException te) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/bc303ab9/src/main/java/freemarker/core/Macro.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/Macro.java b/src/main/java/freemarker/core/Macro.java
index 44b3505..162cad3 100644
--- a/src/main/java/freemarker/core/Macro.java
+++ b/src/main/java/freemarker/core/Macro.java
@@ -19,7 +19,6 @@
 
 package freemarker.core;
 
-import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
@@ -176,11 +175,6 @@ public final class Macro extends TemplateElement implements TemplateModel
{
             return Macro.this;
         }
 
-        void runMacro(Environment env) throws TemplateException, IOException {
-            sanityCheck(env);
-            env.visit(getChildBuffer());
-        }
-
         // Set default parameters, check if all the required parameters are defined.
         void sanityCheck(Environment env) throws TemplateException {
             boolean resolvedAnArg, hasUnresolvedArg;


Mime
View raw message