diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-08-12 08:26:43 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-08-12 09:38:06 +0200 |
commit | c5ee56419572b239233ffb58382408ef44203267 (patch) | |
tree | 57a21166d2bef9511dc84d9873868af01cc0d8a1 /plugins/base/src/main/kotlin/transformers | |
parent | e783eefe0c3b124aa25fdb2b28b9f238d48e293b (diff) | |
download | dokka-c5ee56419572b239233ffb58382408ef44203267.tar.gz dokka-c5ee56419572b239233ffb58382408ef44203267.tar.bz2 dokka-c5ee56419572b239233ffb58382408ef44203267.zip |
EmptyPackagesFilterTransformer & SuppressedDocumentableFilterTransformer: Readability improvements
Diffstat (limited to 'plugins/base/src/main/kotlin/transformers')
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt index c901c9aa..81d03e27 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt @@ -7,7 +7,7 @@ import org.jetbrains.dokka.transformers.documentation.sourceSet class EmptyPackagesFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer { override fun invoke(modules: List<DModule>): List<DModule> { - return modules.mapNotNull { module -> filterModule(module) } + return modules.mapNotNull(::filterModule) } private fun filterModule(module: DModule): DModule? { diff --git a/plugins/base/src/main/kotlin/transformers/documentables/SuppressedDocumentableFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/SuppressedDocumentableFilterTransformer.kt index 5a2818c7..79feb832 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/SuppressedDocumentableFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/SuppressedDocumentableFilterTransformer.kt @@ -10,7 +10,7 @@ import java.io.File class SuppressedDocumentableFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer { override fun invoke(modules: List<DModule>): List<DModule> { - return modules.mapNotNull { module -> filterModule(module) } + return modules.mapNotNull(::filterModule) } private fun filterModule(module: DModule): DModule? { @@ -28,7 +28,7 @@ class SuppressedDocumentableFilterTransformer(val context: DokkaContext) : PreMe return null } - val filteredChildren = pkg.children.filter { child -> !isSuppressed(child) } + val filteredChildren = pkg.children.filterNot(::isSuppressed) return when { filteredChildren == pkg.children -> pkg filteredChildren.isEmpty() -> null |