From e594447648fb7a49f622470cadddb54a23dc83fe Mon Sep 17 00:00:00 2001 From: ShockedPlot7560 Date: Mon, 11 Dec 2023 11:22:09 +0100 Subject: [PATCH] fix PHP 8.3 strange bloat bug --- src/players/util/SortedMap.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/players/util/SortedMap.php b/src/players/util/SortedMap.php index f9b8ba8..de733fc 100644 --- a/src/players/util/SortedMap.php +++ b/src/players/util/SortedMap.php @@ -38,7 +38,9 @@ public function contains(string|int $key) : bool { public function set(string|int $key, mixed $value, int $score) : void { $this->entries[$key] = $value; $this->key_scores[$key] = $score; - uksort($this->key_scores, fn (string $k1, string $k2) : int => $this->key_scores[$k1] <=> $this->key_scores[$k2]); + $scores = $this->key_scores; + uksort($scores, fn (string $k1, string $k2) : int => $this->key_scores[$k1] <=> $this->key_scores[$k2]); + $this->key_scores = $scores; } /**