Fix Utils call

This commit is contained in:
Daniel Schädler 2025-03-09 19:34:15 +01:00
parent 5c6b683526
commit bb61d514a0
2 changed files with 2 additions and 2 deletions

View File

@ -144,7 +144,7 @@ class GroupStageService
first_places = teams_per_group_ranked_transposed[0] first_places = teams_per_group_ranked_transposed[0]
second_places = teams_per_group_ranked_transposed[1] second_places = teams_per_group_ranked_transposed[1]
second_places_new_order = split_and_rotate(second_places) second_places_new_order = Utils.split_and_rotate(second_places)
# zip the first and second places together # zip the first and second places together
# e.g. [1, 2, 3], [a, b, c] to [1, a, 2, b, 3, c] # e.g. [1, 2, 3], [a, b, c] to [1, a, 2, b, 3, c]

View File

@ -32,7 +32,7 @@ class Utils
# split the array in half and place the second half at the beginning # split the array in half and place the second half at the beginning
# e.g. [1, 2, 3, 4, 5, 6] to [4, 5, 6, 1, 2, 3] # e.g. [1, 2, 3, 4, 5, 6] to [4, 5, 6, 1, 2, 3]
def split_and_rotate(array) def self.split_and_rotate(array)
# handle the case where the array has an odd number of elements # handle the case where the array has an odd number of elements
middle_element = [] middle_element = []
if array.length.odd? if array.length.odd?