Skip to content

Commit f420be6

Browse files
committed
When iterating a data file, loop back to the beginning rather than repeat the last element
1 parent 946ee96 commit f420be6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/runner/extensions/waterfall.command.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,8 @@ extractSNR = function (executions, previous) {
5151
* @return {Any} - The data for the iteration
5252
*/
5353
getIterationData = function (data, iteration) {
54-
// if iteration has a corresponding data element use that
55-
if (iteration < data.length) {
56-
return data[iteration];
57-
}
58-
59-
// otherwise use the last data element
60-
return data[data.length - 1];
54+
// if iteration has a corresponding data element use that, otherwise, start from the beginning again.
55+
return data[iteration % data.length];
6156
};
6257

6358
/**

0 commit comments

Comments
 (0)