From 06bcdbd48942bc0cad8f9d39599c75978aec09e9 Mon Sep 17 00:00:00 2001 From: "liubar.pa" Date: Thu, 4 May 2023 18:53:55 +0300 Subject: [PATCH] SNARK-71: better path using --- .../src/main/kotlin/DocumentBuilder.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/snark-document-builder/src/main/kotlin/DocumentBuilder.kt b/snark-document-builder/src/main/kotlin/DocumentBuilder.kt index dffae85..a004ef6 100644 --- a/snark-document-builder/src/main/kotlin/DocumentBuilder.kt +++ b/snark-document-builder/src/main/kotlin/DocumentBuilder.kt @@ -22,13 +22,14 @@ public suspend fun buildDependencyGraph(root: Directory): DependencyGraph { } private suspend fun buildNodes(folder: Directory, nodes: HashMap) { - assert(!nodes.containsKey(folder.getPath())) + val pathString = folder.getPath().pathString + + assert(!nodes.containsKey(pathString)) - val path = folder.getPath() val rootDcoument = folder.get(DEFAULT_DOCUMENT_ROOT) - nodes.put(path, buildDependencyGraphNode(rootDcoument.readAll())) + nodes.put(pathString, buildDependencyGraphNode(rootDcoument.readAll())) - val dependencies = getDependencies(nodes.getValue(path)) + val dependencies = getDependencies(nodes.getValue(pathString)) for (dependency in dependencies) { if (!nodes.containsKey(dependency))