[jruby-joni] 112/194: cleanup

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 b1622bab0f2931e8f655203cf1349c678e5e6073
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Sun Jan 7 18:38:05 2018 +0100

    cleanup
---
 src/org/joni/ByteCodeMachine.java |  1 -
 src/org/joni/CaptureTreeNode.java | 13 +++++--------
 src/org/joni/CodeRangeBuffer.java | 38 +++++++++++++++++++-------------------
 src/org/joni/Matcher.java         |  1 -
 src/org/joni/MinMaxLen.java       |  8 --------
 src/org/joni/OptMapInfo.java      |  2 --
 6 files changed, 24 insertions(+), 39 deletions(-)

diff --git a/src/org/joni/ByteCodeMachine.java b/src/org/joni/ByteCodeMachine.java
index d3ec63c..e55cfc8 100644
--- a/src/org/joni/ByteCodeMachine.java
+++ b/src/org/joni/ByteCodeMachine.java
@@ -30,7 +30,6 @@ import static org.joni.Option.isPosixRegion;
 import org.jcodings.CodeRange;
 import org.jcodings.Encoding;
 import org.jcodings.IntHolder;
-import org.joni.ast.CClassNode;
 import org.joni.constants.OPCode;
 import org.joni.constants.OPSize;
 import org.joni.exception.ErrorMessages;
diff --git a/src/org/joni/CaptureTreeNode.java b/src/org/joni/CaptureTreeNode.java
index 4cbd31d..6bafc99 100644
--- a/src/org/joni/CaptureTreeNode.java
+++ b/src/org/joni/CaptureTreeNode.java
@@ -20,14 +20,12 @@
 package org.joni;
 
 public class CaptureTreeNode {
-
-
     int group;
     int beg;
     int end;
     // int allocated;
     int numChildren;
-    CaptureTreeNode[]children;
+    CaptureTreeNode[] children;
 
     CaptureTreeNode() {
         beg = Region.REGION_NOTPOS;
@@ -36,11 +34,12 @@ public class CaptureTreeNode {
     }
 
     static final int HISTORY_TREE_INIT_ALLOC_SIZE = 8;
+
     void addChild(CaptureTreeNode child) {
         if (children == null) {
             children = new CaptureTreeNode[HISTORY_TREE_INIT_ALLOC_SIZE];
         } else if (numChildren >= children.length) {
-            CaptureTreeNode[]tmp = new CaptureTreeNode[children.length << 1];
+            CaptureTreeNode[] tmp = new CaptureTreeNode[children.length << 1];
             System.arraycopy(children, 0, tmp, 0, children.length);
             children = tmp;
         }
@@ -50,7 +49,7 @@ public class CaptureTreeNode {
     }
 
     void clear() {
-        for (int i=0; i<numChildren; i++) {
+        for (int i = 0; i < numChildren; i++) {
             children[i] = null; // ???
         }
         numChildren = 0;
@@ -63,12 +62,10 @@ public class CaptureTreeNode {
         clone.beg = beg;
         clone.end = end;
 
-        for (int i=0; i<numChildren; i++) {
+        for (int i = 0; i < numChildren; i++) {
             CaptureTreeNode child = children[i].cloneTree();
             clone.addChild(child);
         }
         return clone;
     }
-
-
 }
diff --git a/src/org/joni/CodeRangeBuffer.java b/src/org/joni/CodeRangeBuffer.java
index 1cf04d3..85bb029 100644
--- a/src/org/joni/CodeRangeBuffer.java
+++ b/src/org/joni/CodeRangeBuffer.java
@@ -49,25 +49,6 @@ public final class CodeRangeBuffer {
         used = orig.used;
     }
 
-    public String toString() {
-        StringBuilder buf = new StringBuilder();
-        buf.append("CodeRange");
-        buf.append("\n  used: " + used);
-        buf.append(", size: " + p[0]);
-        buf.append("\n  ranges: ");
-
-        for (int i=0; i<p[0]; i++) {
-            buf.append("[" + rangeNumToString(p[i * 2 + 1]) + ".." + rangeNumToString(p[i * 2 + 2]) + "]");
-            if (i > 0 && i % 6 == 0) buf.append("\n          ");
-        }
-
-        return buf.toString();
-    }
-
-    private static String rangeNumToString(int num){
-        return "0x" + Integer.toString(num, 16);
-    }
-
     public void expand(int low) {
         int length = p.length;
         do { length <<= 1; } while (length < low);
@@ -376,4 +357,23 @@ public final class CodeRangeBuffer {
 
         return pbuf;
     }
+
+    public String toString() {
+        StringBuilder buf = new StringBuilder();
+        buf.append("CodeRange");
+        buf.append("\n  used: " + used);
+        buf.append(", size: " + p[0]);
+        buf.append("\n  ranges: ");
+
+        for (int i=0; i<p[0]; i++) {
+            buf.append("[" + rangeNumToString(p[i * 2 + 1]) + ".." + rangeNumToString(p[i * 2 + 2]) + "]");
+            if (i > 0 && i % 6 == 0) buf.append("\n          ");
+        }
+
+        return buf.toString();
+    }
+
+    private static String rangeNumToString(int num){
+        return "0x" + Integer.toString(num, 16);
+    }
 }
diff --git a/src/org/joni/Matcher.java b/src/org/joni/Matcher.java
index bc122c0..d0b1d62 100644
--- a/src/org/joni/Matcher.java
+++ b/src/org/joni/Matcher.java
@@ -27,7 +27,6 @@ import org.jcodings.IntHolder;
 import org.jcodings.constants.CharacterType;
 import org.jcodings.specific.ASCIIEncoding;
 import org.joni.constants.AnchorType;
-import org.joni.constants.OPCode;
 
 public abstract class Matcher extends IntHolder {
     public static final int FAILED = -1;
diff --git a/src/org/joni/MinMaxLen.java b/src/org/joni/MinMaxLen.java
index 072d5f3..ec08073 100644
--- a/src/org/joni/MinMaxLen.java
+++ b/src/org/joni/MinMaxLen.java
@@ -23,14 +23,6 @@ final class MinMaxLen {
     int min; /* min byte length */
     int max; /* max byte length */
 
-    MinMaxLen() {
-    }
-
-    MinMaxLen(int min, int max) {
-        this.min = min;
-        this.max = max;
-    }
-
     /* 1000 / (min-max-dist + 1) */
     private static final short distValues[] = {
         1000,  500,  333,  250,  200,  167,  143,  125,  111,  100,
diff --git a/src/org/joni/OptMapInfo.java b/src/org/joni/OptMapInfo.java
index a3d0c65..d661595 100644
--- a/src/org/joni/OptMapInfo.java
+++ b/src/org/joni/OptMapInfo.java
@@ -23,10 +23,8 @@ import org.jcodings.CaseFoldCodeItem;
 import org.jcodings.Encoding;
 
 final class OptMapInfo {
-
     final MinMaxLen mmd = new MinMaxLen();          /* info position */
     final OptAnchorInfo anchor = new OptAnchorInfo();
-
     int value;                                      /* weighted value */
     final byte map[] = new byte[Config.CHAR_TABLE_SIZE];
 

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