Skip to content

Commit 4d1c77b

Browse files
committed
Simplify - don't cache dynamic length
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1842178 13f79535-47bb-0310-9956-ffa450edef68
1 parent 7498984 commit 4d1c77b

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/main/java/org/apache/commons/codec/language/ColognePhonetic.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,10 @@ public String colognePhonetic(String text) {
325325
char code;
326326
char chr;
327327

328-
int rightLength = input.length();
329-
330-
while (rightLength > 0) {
328+
while (input.length() > 0) {
331329
chr = input.removeNext();
332330

333-
if ((rightLength = input.length()) > 0) {
331+
if (input.length() > 0) {
334332
nextChar = input.getNextChar();
335333
} else {
336334
nextChar = '-';
@@ -354,7 +352,6 @@ public String colognePhonetic(String text) {
354352
} else if (chr == 'X' && !arrayContains(CKQ, lastChar)) {
355353
code = '4';
356354
input.addLeft('S');
357-
rightLength++;
358355
} else if (chr == 'S' || chr == 'Z') {
359356
code = '8';
360357
} else if (chr == 'C') {

0 commit comments

Comments
 (0)