From e93af75b3df15f41b9a1701763c6815e774eae55 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 4 Aug 2023 00:45:10 +0200 Subject: code cleanup --- .../at/hannibal2/skyhanni/utils/LorenzUtils.kt | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index 8ef5433e0..94d8dd10f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -315,22 +315,22 @@ object LorenzUtils { isCurrent: (T) -> Boolean, onChange: (T) -> Unit, ) { - val newList = mutableListOf() - newList.add(prefix) - for (entry in values) { - val display = getName(entry) - if (isCurrent(entry)) { - newList.add("§a[$display]") - } else { - newList.add("§e[") - newList.add(Renderable.link("§e$display") { - onChange(entry) - }) - newList.add("§e]") + add(buildList { + add(prefix) + for (entry in values) { + val display = getName(entry) + if (isCurrent(entry)) { + add("§a[$display]") + } else { + add("§e[") + add(Renderable.link("§e$display") { + onChange(entry) + }) + add("§e]") + } + add(" ") } - newList.add(" ") - } - add(newList) + }) } // TODO nea? -- cgit