Fix inefficient loop in QueryStringDecoder.decodeComponent()
- Fixes #2228 - There's no point of looping until the end of the component if at least one '%' or '+' is found.
This commit is contained in:
parent
6c02e19d10
commit
c73e1e3c1e
@ -311,13 +311,9 @@ public class QueryStringDecoder {
|
||||
boolean modified = false;
|
||||
for (int i = 0; i < size; i++) {
|
||||
final char c = s.charAt(i);
|
||||
switch (c) {
|
||||
case '%':
|
||||
i++; // We can skip at least one char, e.g. `%%'.
|
||||
// Fall through.
|
||||
case '+':
|
||||
modified = true;
|
||||
break;
|
||||
if (c == '%' || c == '+') {
|
||||
modified = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!modified) {
|
||||
|
Loading…
Reference in New Issue
Block a user