Skip to content

Commit

Permalink
remove redundant function
Browse files Browse the repository at this point in the history
  • Loading branch information
venix12 committed Jan 13, 2025
1 parent 921b989 commit 66283ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 0 additions & 8 deletions app/Models/Season.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ public function endDate(): ?Carbon
: null;
}

public function scoreFactorsOrderedForCalculation(): array
{
$factors = $this->score_factors ?? [];
rsort($factors);

return $factors;
}

public function startDate(): ?Carbon
{
return $this->rooms->min('starts_at');
Expand Down
3 changes: 2 additions & 1 deletion app/Models/UserSeasonScoreAggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function calculate(bool $muteExceptions = true): void
->where('user_id', $this->user_id)
->get();

$factors = $this->season->scoreFactorsOrderedForCalculation();
$factors = $this->season->score_factors;
$roomsGrouped = $rooms->groupBy('pivot.group_indicator');

if ($roomsGrouped->count() > count($factors)) {
Expand All @@ -59,6 +59,7 @@ public function calculate(bool $muteExceptions = true): void
$scores[] = $groupUserScores->max();
}

rsort($factors);
rsort($scores);

$scoreCount = count($scores);
Expand Down

0 comments on commit 66283ac

Please sign in to comment.