[jruby-joni] 125/279: Remove duplication.

Hideki Yamane henrich at moszumanska.debian.org
Mon Nov 16 11:27:12 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 b63609c547f066bf7cc885c646b861908f648746
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Sun Feb 26 14:07:07 2012 +0100

    Remove duplication.
---
 src/org/joni/Analyser.java | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/src/org/joni/Analyser.java b/src/org/joni/Analyser.java
index 4d1b25c..6f1732f 100644
--- a/src/org/joni/Analyser.java
+++ b/src/org/joni/Analyser.java
@@ -1217,6 +1217,15 @@ final class Analyser extends Parser {
         return r;
     }
 
+    private void setCallAttr(CallNode cn) {
+        cn.target = env.memNodes[cn.groupNum]; // no setTarget in call nodes!
+        if (cn.target == null) newValueException(ERR_UNDEFINED_NAME_REFERENCE, cn.nameP, cn.nameEnd);
+
+        ((EncloseNode)cn.target).setCalled();
+        env.btMemStart = BitStatus.bsOnAt(env.btMemStart, cn.groupNum);
+        cn.unsetAddrList = env.unsetAddrList;
+    }
+
     protected final void setupSubExpCall(Node node) {
 
         switch(node.getType()) {
@@ -1254,14 +1263,7 @@ final class Analyser extends Parser {
                     }
                 } // USE_NAMED_GROUP
                 if (gNum > env.numMem) newValueException(ERR_UNDEFINED_GROUP_REFERENCE, cn.nameP, cn.nameEnd);
-
-                // !goto set_call_attr!; // remove duplication ?
-                cn.target = env.memNodes[cn.groupNum]; // no setTarget in call nodes!
-                if (cn.target == null) newValueException(ERR_UNDEFINED_NAME_REFERENCE, cn.nameP, cn.nameEnd);
-
-                ((EncloseNode)cn.target).setCalled();
-                env.btMemStart = BitStatus.bsOnAt(env.btMemStart, cn.groupNum);
-                cn.unsetAddrList = env.unsetAddrList;
+                setCallAttr(cn);
             } else {
                 if (Config.USE_NAMED_GROUP) {
                     NameEntry ne = regex.nameToGroupNumbers(cn.name, cn.nameP, cn.nameEnd);
@@ -1272,13 +1274,7 @@ final class Analyser extends Parser {
                         newValueException(ERR_MULTIPLEX_DEFINITION_NAME_CALL, cn.nameP, cn.nameEnd);
                     } else {
                         cn.groupNum = ne.backRef1; // ne.backNum == 1 ? ne.backRef1 : ne.backRefs[0]; // ??? need to check ?
-                        // !set_call_attr:!
-                        cn.target = env.memNodes[cn.groupNum]; // no setTarget in call nodes!
-                        if (cn.target == null) newValueException(ERR_UNDEFINED_NAME_REFERENCE, cn.nameP, cn.nameEnd);
-
-                        ((EncloseNode)cn.target).setCalled();
-                        env.btMemStart = BitStatus.bsOnAt(env.btMemStart, cn.groupNum);
-                        cn.unsetAddrList = env.unsetAddrList;
+                        setCallAttr(cn);
                     }
                 }
             }

-- 
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