[jruby-joni] 133/279: Do not create new String nodes on end of token.

Hideki Yamane henrich at moszumanska.debian.org
Mon Nov 16 11:27:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository jruby-joni.

commit c95cf6a78639e4d3e60ea7ce6d1e8f046f2abbb4
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Sun Mar 11 18:25:48 2012 +0100

    Do not create new String nodes on end of token.
---
 src/org/joni/Parser.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/org/joni/Parser.java b/src/org/joni/Parser.java
index a5fa50d..ec8ddaa 100644
--- a/src/org/joni/Parser.java
+++ b/src/org/joni/Parser.java
@@ -634,9 +634,7 @@ class Parser extends Lexer {
     }
 
     private Node parseExp(TokenType term) {
-        if (token.type == term) {
-            return new StringNode(); // goto end_of_token
-        }
+        if (token.type == term) return StringNode.EMPTY; // goto end_of_token
 
         Node node = null;
         boolean group = false;
@@ -644,7 +642,7 @@ class Parser extends Lexer {
         switch(token.type) {
         case ALT:
         case EOT:
-            return new StringNode(); // end_of_token:, node_new_empty
+            return StringNode.EMPTY; // end_of_token:, node_new_empty
 
         case SUBEXP_OPEN:
             node = parseEnclose(TokenType.SUBEXP_CLOSE);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby-joni.git



More information about the pkg-java-commits mailing list