Change switch to if (#10880)
Motivation: switch is used when we have a good amount of cases because switch is faster than if-else. However, we're using only 1 case in switch which can affect performance. Modification: Changed switch to if. Result: Good code.
This commit is contained in:
parent
87f5cc5fa2
commit
2b1785458b
@ -489,12 +489,10 @@ public class DefaultHttpHeaders extends HttpHeaders {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (character) {
|
||||
case '\n':
|
||||
return 2;
|
||||
default:
|
||||
throw new IllegalArgumentException("only '\\n' is allowed after '\\r': " + seq);
|
||||
if (character == '\n') {
|
||||
return 2;
|
||||
}
|
||||
throw new IllegalArgumentException("only '\\n' is allowed after '\\r': " + seq);
|
||||
case 2:
|
||||
switch (character) {
|
||||
case '\t':
|
||||
|
Loading…
Reference in New Issue
Block a user