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:
Sebastian Bazley 2012-06-25 18:33:21 +00:00
parent 158ca6f4a0
commit 35d3f7ec77
1 changed files with 7 additions and 9 deletions

View File

@ -331,8 +331,7 @@ public class URLEncodedUtils {
int b = bb.get() & 0xff; int b = bb.get() & 0xff;
if (safechars.get(b)) { if (safechars.get(b)) {
buf.append((char) b); buf.append((char) b);
} else { } else if (blankAsPlus && b == ' ') {
if (blankAsPlus && b == ' ') {
buf.append('+'); buf.append('+');
} else { } else {
buf.append("%"); buf.append("%");
@ -342,7 +341,6 @@ public class URLEncodedUtils {
buf.append(hex2); buf.append(hex2);
} }
} }
}
return buf.toString(); return buf.toString();
} }