11 lines
337 B
Kotlin
11 lines
337 B
Kotlin
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package openpgp
|
|
|
|
/**
|
|
* Filter `null` values from a [Map<K, V?>], turning it into a [Map<K, V>].
|
|
*/
|
|
@Suppress("UNCHECKED_CAST")
|
|
fun <K, V> Map<K, V?>.filterNotNullValues(): Map<K, V> = filterValues { it != null } as Map<K, V> |