Skip to content

Commit

Permalink
When iterating a data file, loop back to the beginning rather than re…
Browse files Browse the repository at this point in the history
…peat the last element
  • Loading branch information
ThePieBandit committed Jun 24, 2022
1 parent 946ee96 commit f420be6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/runner/extensions/waterfall.command.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,8 @@ extractSNR = function (executions, previous) {
* @return {Any} - The data for the iteration
*/
getIterationData = function (data, iteration) {
// if iteration has a corresponding data element use that
if (iteration < data.length) {
return data[iteration];
}

// otherwise use the last data element
return data[data.length - 1];
// if iteration has a corresponding data element use that, otherwise, start from the beginning again.
return data[iteration % data.length];
};

/**
Expand Down

0 comments on commit f420be6

Please sign in to comment.