From b86eec4a6a6678451334a3fa8e5339f0583c290e Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Tue, 16 Apr 2019 20:21:41 +0200 Subject: [PATCH] Improve documentation for generate_playoff_stages method --- app/services/playoff_stage_service.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/services/playoff_stage_service.rb b/app/services/playoff_stage_service.rb index 1168ff4..927db3a 100644 --- a/app/services/playoff_stage_service.rb +++ b/app/services/playoff_stage_service.rb @@ -8,7 +8,8 @@ class PlayoffStageService def self.generate_playoff_stages(teams) playoffs = [] stage_count = calculate_required_stage_count(teams.size) - # initial_matches are the matches in the first stage; this is the only stage filled with teams from the start on + # initial_matches are the matches in the first stage; + # this is the only stage filled with teams from the start of the playoff stage initial_matches = MatchService.generate_matches(teams) initial_stage = Stage.new level: stage_count - 1, matches: initial_matches playoffs << initial_stage @@ -65,6 +66,7 @@ class PlayoffStageService 0 else # black voodoo magic + # h stage_count = Math.log(Utils.previous_power_of_two(number_of_teams)) / Math.log(2) stage_count.to_int end