From c3d8894722c20411d56194e7529b52644307731e Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Tue, 10 Mar 2020 15:30:09 +0100 Subject: Merges documentables with the same source --- core/src/main/kotlin/model/Documentable.kt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/src') diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index 8ff5969c..94bd624a 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -43,6 +43,11 @@ data class PlatformDependent( val prevalentValue: T? get() = map.values.distinct().singleOrNull() + val allValues: Sequence = sequence { + expect?.also { yield(it) } + yieldAll(map.values) + } + companion object { fun empty(): PlatformDependent = PlatformDependent(emptyMap()) fun from(platformData: PlatformData, element: T) = PlatformDependent(mapOf(platformData to element)) -- cgit