[jruby-joni] 186/194: dedup

Hideki Yamane henrich at moszumanska.debian.org
Thu Feb 1 12:04:39 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 b3a9e602b8c58e62a7361f98936b2bab639ecf92
Author: lopex <lopx at gazeta.pl>
Date:   Thu Jan 25 14:57:48 2018 +0100

    dedup
---
 src/org/joni/ByteCodeMachine.java | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/org/joni/ByteCodeMachine.java b/src/org/joni/ByteCodeMachine.java
index 7b9b55a..f3cb802 100644
--- a/src/org/joni/ByteCodeMachine.java
+++ b/src/org/joni/ByteCodeMachine.java
@@ -924,17 +924,14 @@ class ByteCodeMachine extends StackMachine {
     }
 
     private void opAnyChar() {
-        if (s >= range) {opFail(); return;}
-        int n = enc.length(bytes, s, end);
-        if (s + n > range) {opFail(); return;}
-        if (enc.isNewLine(bytes, s, end)) {opFail(); return;}
+        final int n;
+        if (s >= range || s + (n = enc.length(bytes, s, end)) > range || enc.isNewLine(bytes, s, end)) {opFail(); return;}
         s += n;
         sprev = sbegin; // break;
     }
 
     private void opAnyCharSb() {
-        if (s >= range) {opFail(); return;}
-        if (bytes[s] == Encoding.NEW_LINE) {opFail(); return;}
+        if (s >= range || bytes[s] == Encoding.NEW_LINE) {opFail(); return;}
         s++;
         sprev = sbegin; // break;
     }

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