Unnessecary code

This commit is contained in:
2025-07-14 11:39:32 +02:00
parent f4120d28a9
commit 5a939f4447

View File

@@ -35,7 +35,8 @@ class _ActiveGameViewState extends State<ActiveGameView> {
listenable: gameSession, listenable: gameSession,
builder: (context, _) { builder: (context, _) {
sortedPlayerIndices = _getSortedPlayerIndices(); sortedPlayerIndices = _getSortedPlayerIndices();
denseRanks = _calculateDenseRank(gameSession.playerScores); denseRanks = _calculateDenseRank(
gameSession.playerScores, sortedPlayerIndices);
return CupertinoPageScaffold( return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar( navigationBar: CupertinoNavigationBar(
middle: Text(gameSession.gameTitle), middle: Text(gameSession.gameTitle),
@@ -278,8 +279,8 @@ class _ActiveGameViewState extends State<ActiveGameView> {
} }
/// Calculates the dense rank for a player based on their index in the sorted list of players. /// Calculates the dense rank for a player based on their index in the sorted list of players.
List<int> _calculateDenseRank(List<int> playerScores) { List<int> _calculateDenseRank(
List<int> sortedIndices = _getSortedPlayerIndices(); List<int> playerScores, List<int> sortedIndices) {
List<int> denseRanks = []; List<int> denseRanks = [];
int rank = 1; int rank = 1;
for (int i = 0; i < sortedIndices.length; i++) { for (int i = 0; i < sortedIndices.length; i++) {