From 6cb3282b20bf2533a8fde4f6d30e0530d53f63dd Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Wed, 2 Aug 2023 14:23:41 +0200 Subject: Merge pull request #351 * Performance improvements for the damage indicator * Using MutableMap.put * Using Sequence for every entity iteration --- src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/data') diff --git a/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt b/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt index a0b8ae9bc..92f7bebb3 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MayorElection.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.utils.APIUtil import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.put import at.hannibal2.skyhanni.utils.jsonobjects.MayorJson import io.github.moulberry.notenoughupdates.util.SkyBlockTime import kotlinx.coroutines.Dispatchers @@ -74,8 +75,4 @@ class MayorElection { private fun MayorJson.Election.getPairs() = year + 1 to candidates.bestCandidate() private fun List.bestCandidate() = maxBy { it.votes } - - private infix fun MutableMap.put(pairs: Pair) { - this[pairs.first] = pairs.second - } } \ No newline at end of file -- cgit