From 8ccf6ff20ba0c698e97b270f7c91940d250659d0 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 19 Nov 2023 02:13:25 +0100 Subject: code cleanup --- .../features/garden/visitor/GardenVisitorDropStatistics.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt index 28deea65d..b1a02132f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt @@ -219,11 +219,13 @@ object GardenVisitorDropStatistics { @SubscribeEvent fun onConfigLoad(event: ConfigLoadEvent) { val storage = GardenAPI.storage?.visitorDrops ?: return - if (storage.visitorRarities.size == 0) { - storage.visitorRarities.add(0) - storage.visitorRarities.add(0) - storage.visitorRarities.add(0) - storage.visitorRarities.add(0) + val visitorRarities = storage.visitorRarities + if (visitorRarities.size == 0) { + visitorRarities.add(0) + visitorRarities.add(0) + visitorRarities.add(0) + visitorRarities.add(0) + visitorRarities.add(0) } acceptedVisitors = storage.acceptedVisitors deniedVisitors = storage.deniedVisitors -- cgit