From: Lanius Trolling Date: Sat, 13 Apr 2024 15:35:25 +0000 (-0400) Subject: Fix JVM error X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=09b9945e0bfbc0baba82d196b85ed81128bc3db4;p=factbooks Fix JVM error --- diff --git a/src/jvmMain/kotlin/info/mechyrdia/data/ViewsFiles.kt b/src/jvmMain/kotlin/info/mechyrdia/data/ViewsFiles.kt index 3384d4c..6f52079 100644 --- a/src/jvmMain/kotlin/info/mechyrdia/data/ViewsFiles.kt +++ b/src/jvmMain/kotlin/info/mechyrdia/data/ViewsFiles.kt @@ -31,7 +31,7 @@ private val TreeNode.sortIndex: Int is TreeNode.DirNode -> 0 } -private fun Map.sortedAsFiles() = toList() +private fun Map.sortedAsNodes() = toList() .sortedBy { (name, _) -> name } .sortedBy { (_, node) -> node.sortIndex } @@ -52,7 +52,7 @@ private suspend fun fileTree(path: StoragePath): TreeNode? { context(ApplicationCall) private fun UL.render(path: StoragePath, childNodes: Map) { - val sortedChildren = childNodes.sortedAsFiles() + val sortedChildren = childNodes.sortedAsNodes() for ((name, child) in sortedChildren) render(path / name, child)