Skip to content

Commit 8af4938

Browse files
committed
Loop code favor
1 parent 1c15fd1 commit 8af4938

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/main/kotlin/io/github/rothes/esu/core/configuration/LoadedConfiguration.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ data class LoadedConfiguration(
1414

1515
fun save() {
1616
var root = node
17-
while (node.parent() != null) {
18-
root = root.parent()!!
17+
while (true) {
18+
val parent = node.parent() ?: break
19+
root = parent
1920
}
2021
context.loader.save(root)
2122
}

0 commit comments

Comments
 (0)