Guard clause to make Hound woof

This commit is contained in:
Daniel Schädler 2019-11-09 00:00:43 +01:00
parent 8c39fa9894
commit 1a96cefbc8
1 changed files with 4 additions and 4 deletions

View File

@ -18,10 +18,10 @@ class GroupStageService
end
def deal_with_spacing_of_teams(matches, team_size)
if team_size == 4
matches[2].position, matches[4].position = matches[4].position, matches[2].position
matches
end
return unless team_size == 4
matches[2].position, matches[4].position = matches[4].position, matches[2].position
matches
end
def generate_all_matches_between(teams)