refactor: Improve XML performance

This commit is contained in:
LisoUseInAIKyrios
2025-02-11 15:24:29 +02:00
parent e9aee17746
commit 24d68df6cd
6 changed files with 24 additions and 11 deletions
@@ -41,7 +41,10 @@ inline fun Node.forEachChildElement(action: (Element) -> Unit) =
*/
fun Node.doRecursively(action: (Node) -> Unit) {
action(this)
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
val childNodes = this.childNodes
for (i in 0 until childNodes.length) {
childNodes.item(i).doRecursively(action)
}
}
fun Node.insertFirst(node: Node) {