aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorEmpa <42304516+ItsEmpa@users.noreply.github.com>2024-06-12 16:08:29 +0200
committerGitHub <noreply@github.com>2024-06-12 16:08:29 +0200
commit4b3caa47fac5e6f41708b89713582651822dae32 (patch)
treea949b54a558b2d425cf1eb482cc2b208e458ae1e /src/main/java/at/hannibal2/skyhanni/utils
parent0841775557372cfb97a97bb63b3af2f7871a0ec3 (diff)
downloadskyhanni-4b3caa47fac5e6f41708b89713582651822dae32.tar.gz
skyhanni-4b3caa47fac5e6f41708b89713582651822dae32.tar.bz2
skyhanni-4b3caa47fac5e6f41708b89713582651822dae32.zip
Fix: Anniversary Custom Scoreboard (#2058)
Co-authored-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
index 6b4d70046..87261b6d0 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
@@ -133,6 +133,9 @@ object CollectionUtils {
return newList
}
+ /**
+ * This does not work inside a [buildList] block
+ */
fun List<String>.addIfNotNull(element: String?) = element?.let { plus(it) } ?: this
fun <K, V> Map<K, V>.editCopy(function: MutableMap<K, V>.() -> Unit) =