[jruby-joni] 178/194: orphan deprecated jcodings function

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 f7d36741c7e8feacaa760308dbdb94cdaac12545
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Wed Jan 24 19:50:38 2018 +0100

    orphan deprecated jcodings function
---
 src/org/joni/CodeRangeBuffer.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/org/joni/CodeRangeBuffer.java b/src/org/joni/CodeRangeBuffer.java
index 9a88aa3..6d41679 100644
--- a/src/org/joni/CodeRangeBuffer.java
+++ b/src/org/joni/CodeRangeBuffer.java
@@ -19,6 +19,7 @@
  */
 package org.joni;
 
+import org.jcodings.Encoding;
 import org.joni.exception.ErrorMessages;
 import org.joni.exception.ValueException;
 
@@ -184,9 +185,14 @@ public final class CodeRangeBuffer {
         return addCodeRangeToBuff(pbuf, env, from, to, checkDup);
     }
 
+    private static int mbcodeStartPosition(Encoding enc) {
+        return enc.minLength() > 1 ? 0 : 0x80;
+    }
+
+
     // SET_ALL_MULTI_BYTE_RANGE
     protected static CodeRangeBuffer setAllMultiByteRange(ScanEnvironment env, CodeRangeBuffer pbuf) {
-        return addCodeRangeToBuff(pbuf, env, env.enc.mbcodeStartPosition(), LAST_CODE_POINT);
+        return addCodeRangeToBuff(pbuf, env, mbcodeStartPosition(env.enc), LAST_CODE_POINT);
     }
 
     // ADD_ALL_MULTI_BYTE_RANGE
@@ -206,7 +212,7 @@ public final class CodeRangeBuffer {
 
         if (n <= 0) return setAllMultiByteRange(env, pbuf);
 
-        int pre = env.enc.mbcodeStartPosition();
+        int pre = mbcodeStartPosition(env.enc);
 
         int from;
         int to = 0;

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