[jruby-joni] 108/194: extract matchAt initialization

Hideki Yamane henrich at moszumanska.debian.org
Thu Feb 1 12:04:32 UTC 2018


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 219cdefea48341dd1bd6c86dc2696e96065f3fed
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Sun Jan 7 16:49:29 2018 +0100

    extract matchAt initialization
---
 src/org/joni/ByteCodeMachine.java | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/org/joni/ByteCodeMachine.java b/src/org/joni/ByteCodeMachine.java
index 8d031d8..d4a41c0 100644
--- a/src/org/joni/ByteCodeMachine.java
+++ b/src/org/joni/ByteCodeMachine.java
@@ -172,23 +172,24 @@ class ByteCodeMachine extends StackMachine {
         Config.log.println(sb.toString());
     }
 
-    protected final int matchAt(int range, int sstart, int sprev) throws InterruptedException {
-        this.range = range;
-        this.sstart = sstart;
-        this.sprev = sprev;
-
+    protected final int matchAt(int _range, int _sstart, int _sprev) throws InterruptedException {
+        range = _range;
+        sstart = _sstart;
+        sprev = _sprev;
         stk = 0;
         ip = 0;
 
         if (Config.DEBUG_MATCH) debugMatchBegin();
-
         init();
 
         bestLen = -1;
-        s = sstart;
-        pkeep = sstart;
-        Thread currentThread = Thread.currentThread();
+        s = _sstart;
+        pkeep = _sstart;
+        return execute();
+    }
 
+    private final int execute() throws InterruptedException {
+        Thread currentThread = Thread.currentThread();
         final int[]code = this.code;
         while (true) {
             if (interruptCheckCounter++ % INTERRUPT_CHECK_EVERY == 0 && currentThread.isInterrupted()) {
@@ -334,10 +335,8 @@ class ByteCodeMachine extends StackMachine {
                 case OPCode.EXACTN_IC_SB:                   opExactNICSb();              continue;
                 case OPCode.CONDITION:                      opCondition();               continue;
 
-                case OPCode.FINISH:
-                    return finish();
-
-                case OPCode.FAIL:                       opFail();                  continue;
+                case OPCode.FINISH:                         return finish();
+                case OPCode.FAIL:                           opFail();                    continue;
 
                 default:
                     throw new InternalException(ErrorMessages.ERR_UNDEFINED_BYTECODE);

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