Simplify nested if
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1353697 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
158ca6f4a0
commit
35d3f7ec77
|
@ -331,16 +331,14 @@ public class URLEncodedUtils {
|
|||
int b = bb.get() & 0xff;
|
||||
if (safechars.get(b)) {
|
||||
buf.append((char) b);
|
||||
} else if (blankAsPlus && b == ' ') {
|
||||
buf.append('+');
|
||||
} else {
|
||||
if (blankAsPlus && b == ' ') {
|
||||
buf.append('+');
|
||||
} else {
|
||||
buf.append("%");
|
||||
char hex1 = Character.toUpperCase(Character.forDigit((b >> 4) & 0xF, RADIX));
|
||||
char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF, RADIX));
|
||||
buf.append(hex1);
|
||||
buf.append(hex2);
|
||||
}
|
||||
buf.append("%");
|
||||
char hex1 = Character.toUpperCase(Character.forDigit((b >> 4) & 0xF, RADIX));
|
||||
char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF, RADIX));
|
||||
buf.append(hex1);
|
||||
buf.append(hex2);
|
||||
}
|
||||
}
|
||||
return buf.toString();
|
||||
|
|
Loading…
Reference in New Issue