jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1817699 - /jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java
Date Sun, 10 Dec 2017 11:27:46 GMT
Author: fschumacher
Date: Sun Dec 10 11:27:46 2017
New Revision: 1817699

URL: http://svn.apache.org/viewvc?rev=1817699&view=rev
Log:
Calculate length of leftBoundary only once

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java?rev=1817699&r1=1817698&r2=1817699&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/BoundaryExtractor.java Sun Dec
10 11:27:46 2017
@@ -241,13 +241,14 @@ public class BoundaryExtractor extends A
         int startIndex = -1;
         int endIndex;
         int newFound = found;
+        final int leftBoundarylength = leftBoundary.length();
         List<String> matches = new ArrayList<>();
         while(true) {
             startIndex = inputString.indexOf(leftBoundary, startIndex+1);
             if(startIndex >= 0) {
-                endIndex = inputString.indexOf(rightBoundary, startIndex+leftBoundary.length());
+                endIndex = inputString.indexOf(rightBoundary, startIndex+leftBoundarylength);
                 if(endIndex >= 0) {
-                    matches.add(inputString.substring(startIndex+leftBoundary.length(), endIndex));
+                    matches.add(inputString.substring(startIndex+leftBoundarylength, endIndex));
                 } else {
                     break;
                 }
@@ -255,7 +256,7 @@ public class BoundaryExtractor extends A
                 break;
             }
         }
-        
+
         for (String element : matches) {
             if (matchNumber <= 0 || newFound != matchNumber) {
                 result.add(element);



Mime
View raw message