Kotlin / kotlinx.collections.immutable

Immutable persistent collections for Kotlin
Apache License 2.0
1.12k stars 56 forks source link

No orEmpty function for ImmutableList? #182

Open Abhimanyu14 opened 1 month ago

Abhimanyu14 commented 1 month ago

Can we add an extension function similar to List for ImmutableList?

@kotlin.internal.InlineOnly
public inline fun <T> ImmutableList<T>?.orEmpty(): ImmutableList<T> = this ?: persistentListOf()