aboutsummaryrefslogtreecommitdiff
path: root/src/Model/DocumentationNode.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model/DocumentationNode.kt')
-rw-r--r--src/Model/DocumentationNode.kt5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Model/DocumentationNode.kt b/src/Model/DocumentationNode.kt
index 468cb878..4a77f761 100644
--- a/src/Model/DocumentationNode.kt
+++ b/src/Model/DocumentationNode.kt
@@ -123,9 +123,7 @@ public class DocumentationModule(name: String, content: Content = Content.Empty)
val DocumentationNode.path: List<DocumentationNode>
get() {
- val parent = owner
- if (parent == null)
- return listOf(this)
+ val parent = owner ?: return listOf(this)
return parent.path + this
}
@@ -143,6 +141,7 @@ fun DocumentationNode.findOrCreatePackageNode(packageName: String, packageConten
fun DocumentationNode.append(child: DocumentationNode, kind: DocumentationReference.Kind) {
addReferenceTo(child, kind)
+ @suppress("NON_EXHAUSTIVE_WHEN")
when (kind) {
DocumentationReference.Kind.Detail -> child.addReferenceTo(this, DocumentationReference.Kind.Owner)
DocumentationReference.Kind.Member -> child.addReferenceTo(this, DocumentationReference.Kind.Owner)