hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1353678 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
Date Mon, 25 Jun 2012 17:35:35 GMT
Author: olegk
Date: Mon Jun 25 17:35:34 2012
New Revision: 1353678

URL: http://svn.apache.org/viewvc?rev=1353678&view=rev
Log:
HTTPCLIENT-1195: minor optimization

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java?rev=1353678&r1=1353677&r2=1353678&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
Mon Jun 25 17:35:34 2012
@@ -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);



Mime
View raw message