perf: avoid intermediate allocation in bottomNavKeys (#184)

Replaces `.map { ... }.toSet()` with `.mapTo(mutableSetOf()) { ... }`
when resolving `bottomNavKeys` to avoid creating and discarding an
intermediate `ArrayList` during recomposition.
This commit is contained in:
M57
2026-06-20 23:42:40 +03:00
committed by GitHub
parent 3eb9e09f86
commit 34af34af6d
@@ -197,7 +197,7 @@ fun MainNavigation(sessionId: String? = null) {
// recomposes and reflects choices instantly.
val bottomNavItemsState by AuthManager.bottomNavItemsFlow.collectAsState()
val bottomNavItems = resolveBottomNavItems(bottomNavItemsState)
val bottomNavKeys = remember(bottomNavItems) { bottomNavItems.map { it.key }.toSet() }
val bottomNavKeys = remember(bottomNavItems) { bottomNavItems.mapTo(mutableSetOf()) { it.key } }
// Sync primary screens to NavigationController
LaunchedEffect(bottomNavKeys) {