jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1380851 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/MultipartUrlConfig.java
Date Wed, 05 Sep 2012 22:51:53 GMT
On 4 September 2012 21:23,  <pmouawad@apache.org> wrote:
> Author: pmouawad
> Date: Tue Sep  4 20:23:24 2012
> New Revision: 1380851
>
> URL: http://svn.apache.org/viewvc?rev=1380851&view=rev
> Log:
> Use indexOf(char) is faster
>
> Modified:
>     jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/MultipartUrlConfig.java
>
> Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/MultipartUrlConfig.java
> URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/MultipartUrlConfig.java?rev=1380851&r1=1380850&r2=1380851&view=diff
> ==============================================================================
> --- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/MultipartUrlConfig.java
(original)
> +++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/MultipartUrlConfig.java
Tue Sep  4 20:23:24 2012
> @@ -128,14 +128,14 @@ public class MultipartUrlConfig implemen
>                  // Get the form field name
>                  final String namePrefix = "name=\""; //$NON-NLS-1$
>                  int index = contentDisposition.indexOf(namePrefix) + namePrefix.length();
> -                String name = contentDisposition.substring(index, contentDisposition.indexOf("\"",
index)); //$NON-NLS-1$
> +                String name = contentDisposition.substring(index, contentDisposition.indexOf('\"',
index)); //$NON-NLS-1$

$NON-NLS-1$ only applies to Strings.

>
>                  // Check if it is a file being uploaded
>                  final String filenamePrefix = "filename=\""; //$NON-NLS-1$
>                  if (contentDisposition.indexOf(filenamePrefix) > -1) {
>                      // Get the filename
>                      index = contentDisposition.indexOf(filenamePrefix) + filenamePrefix.length();
> -                    String path = contentDisposition.substring(index, contentDisposition.indexOf("\"",
index)); //$NON-NLS-1$
> +                    String path = contentDisposition.substring(index, contentDisposition.indexOf('\"',
index)); //$NON-NLS-1$
>                      if(path != null && path.length() > 0) {
>                          // Set the values retrieved for the file upload
>                          files.addHTTPFileArg(path, name, contentType);
>
>

Mime
View raw message