Skip to content

Commit

Permalink
Merge pull request #1 from appunni-m/fix-3876-do-while-infinite-loop
Browse files Browse the repository at this point in the history
Fix: Netflix#3876 Update task utils: removeIterationFromTaskRefName
  • Loading branch information
appunni-old authored Dec 3, 2023
2 parents 41d4334 + eeca96a commit c685368
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public static String getLoopOverTaskRefNameSuffix(int iteration) {

public static String removeIterationFromTaskRefName(String referenceTaskName) {
String[] tokens = referenceTaskName.split(TaskUtils.LOOP_TASK_DELIMITER);
return tokens.length > 0 ? tokens[0] : referenceTaskName;
int length = tokens.length;
return length > 1 ? String.join(
TaskUtils.LOOP_TASK_DELIMITER,
Arrays.copyOf(tokens, length - 1)
) : referenceTaskName;
}
}

0 comments on commit c685368

Please sign in to comment.