aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/ComponentMatcherUtils.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ComponentMatcherUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ComponentMatcherUtils.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ComponentMatcherUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ComponentMatcherUtils.kt
index 9faa3cd74..f332cc05e 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ComponentMatcherUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ComponentMatcherUtils.kt
@@ -249,9 +249,9 @@ class ComponentSpan internal constructor(
fun intoComponent(): IChatComponent {
val parent = ChatComponentText("")
parent.chatStyle = ChatStyle()
- sampleSlicedComponents().forEach {
- val copy = ChatComponentText(it.first.unformattedTextForChat.substring(it.second, it.third))
- copy.chatStyle = it.first.chatStyle.createDeepCopy()
+ for ((component, start, end) in sampleSlicedComponents()) {
+ val copy = ChatComponentText(component.unformattedTextForChat.substring(start, end))
+ copy.chatStyle = component.chatStyle.createDeepCopy()
parent.appendSibling(copy)
}
return parent