Skip to content

Commit

Permalink
A small optimization for the fix of netty#360
Browse files Browse the repository at this point in the history
  • Loading branch information
normanmaurer authored and trustin committed May 31, 2012
1 parent f2df20d commit 7fb64e2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@ public String readLine() throws IOException {
lineBuf.append((char) b);
}

while ( lineBuf.length() > 0 &&
lineBuf.charAt(lineBuf.length() - 1) == '\r') {
lineBuf.setLength(lineBuf.length() - 1);
if (lineBuf.length() > 0 ) {
while (lineBuf.charAt(lineBuf.length() - 1) == '\r') {
lineBuf.setLength(lineBuf.length() - 1);
}
}

return lineBuf.toString();
Expand Down

0 comments on commit 7fb64e2

Please sign in to comment.