diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-08-25 14:28:44 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-31 15:10:04 +0200 |
commit | 29cc17ba80018e3e45a5fabcf2e370c735fd5674 (patch) | |
tree | 4845c0d56582c290c69427769a032e8a017c2773 /core/src/main/kotlin | |
parent | 333091e5c5f896769c3371dd74c87a52ffa9562a (diff) | |
download | dokka-29cc17ba80018e3e45a5fabcf2e370c735fd5674.tar.gz dokka-29cc17ba80018e3e45a5fabcf2e370c735fd5674.tar.bz2 dokka-29cc17ba80018e3e45a5fabcf2e370c735fd5674.zip |
Implement ModuleAndPackageDocumentationReader
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r-- | core/src/main/kotlin/utilities/associateWithNotNull.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/main/kotlin/utilities/associateWithNotNull.kt b/core/src/main/kotlin/utilities/associateWithNotNull.kt new file mode 100644 index 00000000..ea2e8c3c --- /dev/null +++ b/core/src/main/kotlin/utilities/associateWithNotNull.kt @@ -0,0 +1,6 @@ +package org.jetbrains.dokka.utilities + +inline fun <K, V : Any> Iterable<K>.associateWithNotNull(valueSelector: (K) -> V?): Map<K, V> { + @Suppress("UNCHECKED_CAST") + return associateWith { valueSelector(it) }.filterValues { it != null } as Map<K, V> +} |