diff --git a/app/src/main/kotlin/com/aliucord/manager/ui/util/UnsafeImmutables.kt b/app/src/main/kotlin/com/aliucord/manager/ui/util/UnsafeImmutables.kt index 6d27bbc..285d533 100644 --- a/app/src/main/kotlin/com/aliucord/manager/ui/util/UnsafeImmutables.kt +++ b/app/src/main/kotlin/com/aliucord/manager/ui/util/UnsafeImmutables.kt @@ -1,4 +1,4 @@ -@file:Suppress("unused") +@file:Suppress("unused", "NOTHING_TO_INLINE") package com.aliucord.manager.ui.util @@ -12,18 +12,18 @@ import kotlinx.collections.immutable.adapters.* * and assumes the user knows that it shouldn't change through crucial parts of rendering. */ -fun Collection.toUnsafeImmutable(): ImmutableCollection = +inline fun Collection.toUnsafeImmutable(): ImmutableCollection = ImmutableCollectionAdapter(this) -fun List.toUnsafeImmutable(): ImmutableList = +inline fun List.toUnsafeImmutable(): ImmutableList = ImmutableListAdapter(this) -fun Set.toUnsafeImmutable(): ImmutableSet = +inline fun Set.toUnsafeImmutable(): ImmutableSet = ImmutableSetAdapter(this) -fun Map.toUnsafeImmutable(): ImmutableMap = +inline fun Map.toUnsafeImmutable(): ImmutableMap = ImmutableMapAdapter(this) -fun emptyImmutableList(): ImmutableList = persistentListOf() -fun emptyImmutableSet(): ImmutableSet = persistentSetOf() -fun emptyImmutableMap(): ImmutableMap = persistentMapOf() +inline fun emptyImmutableList(): ImmutableList = persistentListOf() +inline fun emptyImmutableSet(): ImmutableSet = persistentSetOf() +inline fun emptyImmutableMap(): ImmutableMap = persistentMapOf()