[jruby-joni] 104/194: fix potential COW problem when catenating code points

Hideki Yamane henrich at moszumanska.debian.org
Thu Feb 1 12:04:31 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 924b24e410fdce8024a041abf3aca2612c158572
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Thu Jan 4 21:57:50 2018 +0100

    fix potential COW problem when catenating code points
---
 src/org/joni/ast/StringNode.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/org/joni/ast/StringNode.java b/src/org/joni/ast/StringNode.java
index 5db44b5..d75d074 100644
--- a/src/org/joni/ast/StringNode.java
+++ b/src/org/joni/ast/StringNode.java
@@ -113,7 +113,7 @@ public final class StringNode extends Node implements StringType {
 
         if (end > p) {
             int prev = enc.prevCharHead(bytes, p, end, end);
-            if (prev != -1 && prev > p) { /* can be splitted. */
+            if (prev != -1 && prev > p) { /* can be split */
                 n = new StringNode(bytes, prev, end);
                 if (isRaw()) n.setRaw();
                 end = prev;
@@ -149,7 +149,7 @@ public final class StringNode extends Node implements StringType {
     }
 
     public void catCode(int code, Encoding enc) {
-        ensure(Config.ENC_CODE_TO_MBC_MAXLEN);
+        modifyEnsure(Config.ENC_CODE_TO_MBC_MAXLEN);
         end += enc.codeToMbc(code, bytes, end);
     }
 

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