HTTPCLIENT-1195: minor optimization

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1353678 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2012-06-25 17:35:34 +00:00
parent 3d3457f458
commit 158ca6f4a0
1 changed files with 2 additions and 2 deletions

View File

@ -332,7 +332,7 @@ public class URLEncodedUtils {
if (safechars.get(b)) { if (safechars.get(b)) {
buf.append((char) b); buf.append((char) b);
} else { } else {
if (b == ' ' && blankAsPlus) { if (blankAsPlus && b == ' ') {
buf.append('+'); buf.append('+');
} else { } else {
buf.append("%"); buf.append("%");
@ -377,7 +377,7 @@ public class URLEncodedUtils {
bb.put((byte) uc); bb.put((byte) uc);
bb.put((byte) lc); bb.put((byte) lc);
} }
} else if (c == '+' && plusAsBlank) { } else if (plusAsBlank && c == '+') {
bb.put((byte) ' '); bb.put((byte) ' ');
} else { } else {
bb.put((byte) c); bb.put((byte) c);