diff options
| author | Goooler <wangzongler@gmail.com> | 2022-02-21 22:01:06 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-21 17:01:06 +0300 |
| commit | f5b7797255576e5f1c230e2ca3fcb5f4e602387c (patch) | |
| tree | 25fd98250066c4ed6c2fff1104be533604bbf1b9 /core/src/main/kotlin/model | |
| parent | df4780c31026aaa626746f49f0e6fa3fa0278a05 (diff) | |
| download | dokka-f5b7797255576e5f1c230e2ca3fcb5f4e602387c.tar.gz dokka-f5b7797255576e5f1c230e2ca3fcb5f4e602387c.tar.bz2 dokka-f5b7797255576e5f1c230e2ca3fcb5f4e602387c.zip | |
Code cleanups (#2165)
Diffstat (limited to 'core/src/main/kotlin/model')
| -rw-r--r-- | core/src/main/kotlin/model/Documentable.kt | 2 | ||||
| -rw-r--r-- | core/src/main/kotlin/model/WithChildren.kt | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index fcbb9591..13d04555 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -126,7 +126,7 @@ data class DPackage( * e.g. this will return a human readable version for root packages. * Use [packageName] or `dri.packageName` instead to obtain the real packageName */ - override val name: String = if (packageName.isBlank()) "[root]" else packageName + override val name: String = packageName.ifBlank { "[root]" } override val children: List<Documentable> = properties + functions + classlikes + typealiases diff --git a/core/src/main/kotlin/model/WithChildren.kt b/core/src/main/kotlin/model/WithChildren.kt index 59a14acc..01a188c8 100644 --- a/core/src/main/kotlin/model/WithChildren.kt +++ b/core/src/main/kotlin/model/WithChildren.kt @@ -79,10 +79,10 @@ fun <T : WithChildren<T>> T.asPrintableTree( nodeNameBuilder(element) appendLine() element.children.takeIf(Collection<*>::isNotEmpty)?.also { children -> - val newOwnPrefix = childPrefix + '\u251c' + '\u2500' + ' ' - val lastOwnPrefix = childPrefix + '\u2514' + '\u2500' + ' ' - val newChildPrefix = childPrefix + '\u2502' + ' ' + ' ' - val lastChildPrefix = childPrefix + ' ' + ' ' + ' ' + val newOwnPrefix = "$childPrefix├─ " + val lastOwnPrefix = "$childPrefix└─ " + val newChildPrefix = "$childPrefix│ " + val lastChildPrefix = "$childPrefix " children.forEachIndexed { n, e -> if (n != children.lastIndex) append(e, newOwnPrefix, newChildPrefix) else append(e, lastOwnPrefix, lastChildPrefix) |
