A small optimization for the fix of #360

This commit is contained in:
norman 2012-05-24 08:47:35 +02:00 committed by Trustin Lee
parent f2df20ddff
commit 7fb64e2046

View File

@ -195,10 +195,11 @@ public class ChannelBufferInputStream extends InputStream implements DataInput {
lineBuf.append((char) b);
}
while ( lineBuf.length() > 0 &&
lineBuf.charAt(lineBuf.length() - 1) == '\r') {
if (lineBuf.length() > 0 ) {
while (lineBuf.charAt(lineBuf.length() - 1) == '\r') {
lineBuf.setLength(lineBuf.length() - 1);
}
}
return lineBuf.toString();
}