Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When iterating a data file, loop back to the beginning... #1218

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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