Skip to content

Commit 81b6c11

Browse files
committed
Remove unnecessary code. Changed test from:
if ((to == -1) || (to == termnator)) { to: if (to == termnator) { since we are guaranteed to find the separator because we have tested for its presence at the begining of the method. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@798422 13f79535-47bb-0310-9956-ffa450edef68
1 parent 02a1e84 commit 81b6c11

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/java/org/apache/commons/codec/net/RFC1522Codec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected String decodeText(final String text)
121121
int termnator = text.length() - 2;
122122
int from = 2;
123123
int to = text.indexOf(SEP, from);
124-
if ((to == -1) || (to == termnator)) {
124+
if (to == termnator) {
125125
throw new DecoderException("RFC 1522 violation: charset token not found");
126126
}
127127
String charset = text.substring(from, to);

0 commit comments

Comments
 (0)