aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Model
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/Model')
-rw-r--r--core/src/main/kotlin/Model/DocumentationNode.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt
index 813ff0f5..a145ae8d 100644
--- a/core/src/main/kotlin/Model/DocumentationNode.kt
+++ b/core/src/main/kotlin/Model/DocumentationNode.kt
@@ -1,6 +1,5 @@
package org.jetbrains.dokka
-import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
import java.util.*
enum class NodeKind {
@@ -110,7 +109,7 @@ open class DocumentationNode(val name: String,
get() = details(NodeKind.Supertype)
val superclass: DocumentationNode?
- get() = supertypes.firstNotNullResult { it.links.firstOrNull { it.kind in NodeKind.classLike } }
+ get() = supertypes.firstOrNull { it.links.any { it.kind in NodeKind.classLike } }
// TODO: Should we allow node mutation? Model merge will copy by ref, so references are transparent, which could nice
fun addReferenceTo(to: DocumentationNode, kind: RefKind) {
@@ -163,7 +162,7 @@ val DocumentationNode.path: List<DocumentationNode>
}
fun DocumentationNode.findOrCreatePackageNode(packageName: String, packageContent: Map<String, Content>, refGraph: NodeReferenceGraph): DocumentationNode {
- val existingNode = members(NodeKind.Package).firstOrNull { it.name == packageName }
+ val existingNode = members(NodeKind.Package).firstOrNull { it.name == packageName }
if (existingNode != null) {
return existingNode
}
@@ -181,7 +180,8 @@ fun DocumentationNode.append(child: DocumentationNode, kind: RefKind) {
RefKind.Detail -> child.addReferenceTo(this, RefKind.Owner)
RefKind.Member -> child.addReferenceTo(this, RefKind.Owner)
RefKind.Owner -> child.addReferenceTo(this, RefKind.Member)
- else -> { /* Do not add any links back for other types */ }
+ else -> { /* Do not add any links back for other types */
+ }
}
}