From 3258a35b0d71adf858b3c446bab77048ed87ffdf Mon Sep 17 00:00:00 2001 From: tako <74718793+TakoTheDev@users.noreply.github.com> Date: Sun, 6 Oct 2024 21:09:47 +0200 Subject: [PATCH] fix: startsWithAny function uses contains (#516) --- src/main/kotlin/gg/skytils/skytilsmod/utils/StringUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/utils/StringUtils.kt b/src/main/kotlin/gg/skytils/skytilsmod/utils/StringUtils.kt index db75d4baf..f10a454f1 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/utils/StringUtils.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/utils/StringUtils.kt @@ -25,7 +25,7 @@ fun CharSequence?.countMatches(subString: CharSequence): Int = ApacheStringUtils fun String?.stripControlCodes(): String = UTextComponent.stripFormatting(this ?: "") fun CharSequence?.startsWithAny(vararg sequences: CharSequence?) = ApacheStringUtils.startsWithAny(this, *sequences) -fun CharSequence.startsWithAny(sequences: Iterable): Boolean = sequences.any { contains(it) } +fun CharSequence.startsWithAny(sequences: Iterable): Boolean = sequences.any { startsWith(it) } fun CharSequence?.containsAny(vararg sequences: CharSequence?): Boolean { if (this == null) return false return sequences.any { it != null && this.contains(it) }