Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Rename fields before refactoring.

  • Loading branch information...
commit 9722c2b0f824d6c708492ec3780520255f99257e 1 parent 6fc175d
Marcin Mielżyński lopex authored

Showing 2 changed files with 14 additions and 15 deletions. Show diff stats Hide diff stats

  1. +13 14 src/org/joni/OptExactInfo.java
  2. +1 1  src/org/joni/Regex.java
27 src/org/joni/OptExactInfo.java
@@ -29,9 +29,9 @@
29 29
30 30 boolean reachEnd;
31 31 boolean ignoreCase;
32   - int length;
33 32
34   - final byte s[] = new byte[OPT_EXACT_MAXLEN];
  33 + final byte bytes[] = new byte[OPT_EXACT_MAXLEN];
  34 + int length;
35 35
36 36 boolean isFull() {
37 37 return length >= OPT_EXACT_MAXLEN;
@@ -44,7 +44,6 @@ void clear() {
44 44 reachEnd = false;
45 45 ignoreCase = false;
46 46 length = 0;
47   - s[0] = 0; // ???
48 47 }
49 48
50 49 void copy(OptExactInfo other) {
@@ -54,7 +53,7 @@ void copy(OptExactInfo other) {
54 53 ignoreCase = other.ignoreCase;
55 54 length = other.length;
56 55
57   - System.arraycopy(other.s, 0, s, 0, OPT_EXACT_MAXLEN);
  56 + System.arraycopy(other.bytes, 0, bytes, 0, OPT_EXACT_MAXLEN);
58 57 }
59 58
60 59 void concat(OptExactInfo other, Encoding enc) {
@@ -68,10 +67,10 @@ void concat(OptExactInfo other, Encoding enc) {
68 67
69 68 int i;
70 69 for (i=length; p < end;) {
71   - int len = enc.length(other.s, p, end);
  70 + int len = enc.length(other.bytes, p, end);
72 71 if (i + len > OPT_EXACT_MAXLEN) break;
73 72 for (int j=0; j<len && p < end; j++) {
74   - s[i++] = other.s[p++]; // arraycopy or even don't copy anything ??
  73 + bytes[i++] = other.bytes[p++]; // arraycopy or even don't copy anything ??
75 74 }
76 75 }
77 76
@@ -85,13 +84,13 @@ void concat(OptExactInfo other, Encoding enc) {
85 84 }
86 85
87 86 // ?? raw is not used here
88   - void concatStr(byte[]bytes, int p, int end, boolean raw, Encoding enc) {
  87 + void concatStr(byte[]lbytes, int p, int end, boolean raw, Encoding enc) {
89 88 int i;
90 89 for (i = length; p < end && i < OPT_EXACT_MAXLEN;) {
91   - int len = enc.length(bytes, p, end);
  90 + int len = enc.length(lbytes, p, end);
92 91 if (i + len > OPT_EXACT_MAXLEN) break;
93 92 for (int j=0; j<len && p < end; j++) {
94   - s[i++] = bytes[p++];
  93 + bytes[i++] = lbytes[p++];
95 94 }
96 95 }
97 96
@@ -111,12 +110,12 @@ void altMerge(OptExactInfo other, OptEnvironment env) {
111 110
112 111 int i;
113 112 for (i=0; i<length && i<other.length;) {
114   - if (s[i] != other.s[i]) break;
115   - int len = env.enc.length(s, i, length);
  113 + if (bytes[i] != other.bytes[i]) break;
  114 + int len = env.enc.length(bytes, i, length);
116 115
117 116 int j;
118 117 for (j=1; j<len; j++) {
119   - if (s[i+j] != other.s[i+j]) break;
  118 + if (bytes[i+j] != other.bytes[i+j]) break;
120 119 }
121 120
122 121 if (j < len) break;
@@ -145,8 +144,8 @@ void select(OptExactInfo alt, Encoding enc) {
145 144 return;
146 145 } else if (v1 <= 2 && v2 <= 2) {
147 146 /* ByteValTable[x] is big value --> low price */
148   - v2 = OptMapInfo.positionValue(enc, s[0] & 0xff);
149   - v1 = OptMapInfo.positionValue(enc, alt.s[0] & 0xff);
  147 + v2 = OptMapInfo.positionValue(enc, bytes[0] & 0xff);
  148 + v1 = OptMapInfo.positionValue(enc, alt.bytes[0] & 0xff);
150 149
151 150 if (length > 1) v1 += 5;
152 151 if (alt.length > 1) v2 += 5;
2  src/org/joni/Regex.java
@@ -306,7 +306,7 @@ void setExactInfo(OptExactInfo e) {
306 306 if (e.length == 0) return;
307 307
308 308 // shall we copy that ?
309   - exact = e.s;
  309 + exact = e.bytes;
310 310 exactP = 0;
311 311 exactEnd = e.length;
312 312

0 comments on commit 9722c2b

Please sign in to comment.
Something went wrong with that request. Please try again.