From f420be6748a666818ed461a87862cde46f45e74f Mon Sep 17 00:00:00 2001 From: ThePieBandit <61213359+ThePieBandit@users.noreply.github.com> Date: Thu, 23 Jun 2022 22:38:18 -0400 Subject: [PATCH] When iterating a data file, loop back to the beginning rather than repeat the last element --- lib/runner/extensions/waterfall.command.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/runner/extensions/waterfall.command.js b/lib/runner/extensions/waterfall.command.js index e827e8117..247316456 100644 --- a/lib/runner/extensions/waterfall.command.js +++ b/lib/runner/extensions/waterfall.command.js @@ -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]; }; /**