freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [18/23] incubator-freemarker git commit: (TemplateElement.getChildNodes code cleanup)
Date Tue, 15 Dec 2015 23:26:23 GMT
(TemplateElement.getChildNodes code cleanup)


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

Branch: refs/heads/master
Commit: 77d44df1e769c1f74e673000941028a3430fdb0e
Parents: 1cb2a5f
Author: ddekany <ddekany@apache.org>
Authored: Mon Dec 14 22:59:16 2015 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Mon Dec 14 22:59:16 2015 +0100

----------------------------------------------------------------------
 src/main/java/freemarker/core/TemplateElement.java    | 4 ++--
 src/main/java/freemarker/template/SimpleSequence.java | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/77d44df1/src/main/java/freemarker/core/TemplateElement.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/TemplateElement.java b/src/main/java/freemarker/core/TemplateElement.java
index 4cf195b..7d3139a 100644
--- a/src/main/java/freemarker/core/TemplateElement.java
+++ b/src/main/java/freemarker/core/TemplateElement.java
@@ -160,15 +160,15 @@ abstract public class TemplateElement extends TemplateObject {
     }
 
     public TemplateSequenceModel getChildNodes() {
-        SimpleSequence result = new SimpleSequence(1);
         if (childBuffer != null) {
             final SimpleSequence seq = new SimpleSequence(childCount);
             for (int i = 0; i < childCount; i++) {
                 seq.add(childBuffer[i]);
             }
             return seq;
+        } else {
+            return new SimpleSequence(0);
         }
-        return result;
     }
 
     public String getNodeName() {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/77d44df1/src/main/java/freemarker/template/SimpleSequence.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/SimpleSequence.java b/src/main/java/freemarker/template/SimpleSequence.java
index 2730d58..0cc9411 100644
--- a/src/main/java/freemarker/template/SimpleSequence.java
+++ b/src/main/java/freemarker/template/SimpleSequence.java
@@ -99,7 +99,6 @@ public class SimpleSequence extends WrappingTemplateModel implements TemplateSeq
     public SimpleSequence(int capacity) {
         list = new ArrayList(capacity);
     }
-
     
     /**
      * Constructs a simple sequence that will contain the elements


Mime
View raw message