IDEA-330211 use a sequence

Converted getShownThemes in LafManagerImpl to Kotlin Sequence to improve performance. Sequence interface in Kotlin allows to perform computation on elements as needed, which could reduce the overhead in theme fetching.

GitOrigin-RevId: a11bf6fe8c53916517b76c5e2093e31076693401
This commit is contained in:
Vladimir Krivosheev
2023-09-03 23:39:26 +00:00
committed by intellij-monorepo-bot
parent 2cc7b5fda2
commit 77c8abea2a
@@ -916,7 +916,7 @@ class LafManagerImpl(private val coroutineScope: CoroutineScope) : LafManager(),
get() {
val lightLaFs = ArrayList<UIThemeLookAndFeelInfo>()
val darkLaFs = ArrayList<UIThemeLookAndFeelInfo>()
for (lafInfo in ThemeListProvider.getInstance().getShownThemes().flatten()) {
for (lafInfo in ThemeListProvider.getInstance().getShownThemes().asSequence().flatten()) {
if (lafInfo.theme.isDark) {
darkLaFs.add(lafInfo)
}