Skip to content

Commit 8c75343

Browse files
committed
No need to nest elses
1 parent 0cf4f11 commit 8c75343

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ private int getEncodedCharLength(final int current) throws CharacterCodingExcept
140140
if (Character.isHighSurrogate(cChar)) {
141141
// Move on to the next char (low surrogate)
142142
return 0;
143-
} else if (Character.isSurrogatePair(lChar, cChar)) {
143+
}
144+
if (Character.isSurrogatePair(lChar, cChar)) {
144145
return encoder.encode(CharBuffer.wrap(new char[] { lChar, cChar })).limit();
145-
} else {
146-
throw new CharacterCodingException();
147146
}
147+
throw new CharacterCodingException();
148148
}
149149

150150
/**

0 commit comments

Comments
 (0)