From 158ca6f4a07f795688b5ca96cf39413a83c8c5d6 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Mon, 25 Jun 2012 17:35:34 +0000 Subject: [PATCH] HTTPCLIENT-1195: minor optimization git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1353678 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/http/client/utils/URLEncodedUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java b/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java index e2b6c3d2a..5996e55c5 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java +++ b/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java @@ -332,7 +332,7 @@ public class URLEncodedUtils { if (safechars.get(b)) { buf.append((char) b); } else { - if (b == ' ' && blankAsPlus) { + if (blankAsPlus && b == ' ') { buf.append('+'); } else { buf.append("%"); @@ -377,7 +377,7 @@ public class URLEncodedUtils { bb.put((byte) uc); bb.put((byte) lc); } - } else if (c == '+' && plusAsBlank) { + } else if (plusAsBlank && c == '+') { bb.put((byte) ' '); } else { bb.put((byte) c);