jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1780668 - /jmeter/trunk/src/components/org/apache/jmeter/control/RandomController.java
Date Sat, 28 Jan 2017 12:17:20 GMT
Author: fschumacher
Date: Sat Jan 28 12:17:20 2017
New Revision: 1780668

URL: http://svn.apache.org/viewvc?rev=1780668&view=rev
Log:
Use isEmpty instead of size on a list to check whether it is empty. Reorder the if/else clause
to avoid negation.

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/control/RandomController.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/RandomController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/RandomController.java?rev=1780668&r1=1780667&r2=1780668&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/RandomController.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/RandomController.java Sat Jan 28
12:17:20 2017
@@ -35,10 +35,10 @@ public class RandomController extends In
      */
     @Override
     protected void resetCurrent() {
-        if (getSubControllers().size() > 0) {
-            current = ThreadLocalRandom.current().nextInt(this.getSubControllers().size());
-        } else {
+        if (getSubControllers().isEmpty()) {
             current = 0;
+        } else {
+            current = ThreadLocalRandom.current().nextInt(this.getSubControllers().size());
         }
     }
 



Mime
View raw message