mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Perform toImmutableList() less often.
This commit is contained in:
committed by
Benoit Marty
parent
c98601c3c3
commit
87a1b79726
+4
-3
@@ -39,6 +39,7 @@ import io.element.android.libraries.featureflag.api.FeatureFlagService
|
|||||||
import io.element.android.libraries.featureflag.api.FeatureFlags
|
import io.element.android.libraries.featureflag.api.FeatureFlags
|
||||||
import io.element.android.libraries.featureflag.ui.model.FeatureUiModel
|
import io.element.android.libraries.featureflag.ui.model.FeatureUiModel
|
||||||
import io.element.android.libraries.preferences.api.store.AppPreferencesStore
|
import io.element.android.libraries.preferences.api.store.AppPreferencesStore
|
||||||
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import kotlinx.collections.immutable.toImmutableList
|
import kotlinx.collections.immutable.toImmutableList
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
@@ -146,7 +147,7 @@ class DeveloperSettingsPresenter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return DeveloperSettingsState(
|
return DeveloperSettingsState(
|
||||||
features = featureUiModels.toImmutableList(),
|
features = featureUiModels,
|
||||||
cacheSize = cacheSize.value,
|
cacheSize = cacheSize.value,
|
||||||
clearCacheAction = clearCacheAction.value,
|
clearCacheAction = clearCacheAction.value,
|
||||||
rageshakeState = rageshakeState,
|
rageshakeState = rageshakeState,
|
||||||
@@ -165,7 +166,7 @@ class DeveloperSettingsPresenter(
|
|||||||
@Composable
|
@Composable
|
||||||
private fun createUiModels(
|
private fun createUiModels(
|
||||||
enabledFeatures: SnapshotStateList<EnabledFeature>,
|
enabledFeatures: SnapshotStateList<EnabledFeature>,
|
||||||
): List<FeatureUiModel> {
|
): ImmutableList<FeatureUiModel> {
|
||||||
return enabledFeatures.map { enabledFeature ->
|
return enabledFeatures.map { enabledFeature ->
|
||||||
key(enabledFeature.feature.key) {
|
key(enabledFeature.feature.key) {
|
||||||
remember(enabledFeature) {
|
remember(enabledFeature) {
|
||||||
@@ -178,7 +179,7 @@ class DeveloperSettingsPresenter(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}.toImmutableList()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun CoroutineScope.updateEnabledFeature(
|
private fun CoroutineScope.updateEnabledFeature(
|
||||||
|
|||||||
Reference in New Issue
Block a user