aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-23 12:50:30 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-23 12:50:30 +0200
commitdb2e655cd52fd0416130ee65c526e575adc34b94 (patch)
tree55ef1abd548830cf0e6710b56f60b6766874ecf5
parent1701140aa6829c8282fc11a2f8cecb782ac44ed0 (diff)
downloadskyhanni-db2e655cd52fd0416130ee65c526e575adc34b94.tar.gz
skyhanni-db2e655cd52fd0416130ee65c526e575adc34b94.tar.bz2
skyhanni-db2e655cd52fd0416130ee65c526e575adc34b94.zip
code cleanup
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt7
1 files 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()