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;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
switch (character) {
|
if (character == '\n') {
|
||||||
case '\n':
|
return 2;
|
||||||
return 2;
|
|
||||||
default:
|
|
||||||
throw new IllegalArgumentException("only '\\n' is allowed after '\\r': " + seq);
|
|
||||||
}
|
}
|
||||||
|
throw new IllegalArgumentException("only '\\n' is allowed after '\\r': " + seq);
|
||||||
case 2:
|
case 2:
|
||||||
switch (character) {
|
switch (character) {
|
||||||
case '\t':
|
case '\t':
|
||||||
|
Loading…
Reference in New Issue
Block a user