From db2e655cd52fd0416130ee65c526e575adc34b94 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:50:30 +0200 Subject: code cleanup --- src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt index 7a7eeeb60..f0eb8e059 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt @@ -19,17 +19,16 @@ object StringUtils { } fun String.removeColor(): String { - val builder = StringBuilder() + val builder = StringBuilder(this.length) var counter = 0 while (counter < this.length) { if (this[counter] == 'ยง') { counter += 2 continue - } else { - builder.append(this[counter]) - counter++ } + builder.append(this[counter]) + counter++ } return builder.toString() -- cgit