Uses fastAny to avoid creating an iterator

This commit is contained in:
Vitor Pamplona
2025-05-14 18:29:03 -04:00
parent acf944ebac
commit c0ecda94a3
@@ -20,6 +20,7 @@
*/ */
package com.vitorpamplona.amethyst.ui.screen.loggedIn.home.dal package com.vitorpamplona.amethyst.ui.screen.loggedIn.home.dal
import androidx.compose.ui.util.fastAny
import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.model.Account
import com.vitorpamplona.amethyst.model.LocalCache import com.vitorpamplona.amethyst.model.LocalCache
import com.vitorpamplona.amethyst.model.Note import com.vitorpamplona.amethyst.model.Note
@@ -93,7 +94,7 @@ class HomeNewThreadFeedFilter(
filterParams: FilterByListParams, filterParams: FilterByListParams,
): Boolean { ): Boolean {
val noteEvent = it.event val noteEvent = it.event
val isGlobalRelay = it.relays.any { globalRelays.contains(it.url) } val isGlobalRelay = it.relays.fastAny { globalRelays.contains(it.url) }
return ( return (
noteEvent is TextNoteEvent || noteEvent is TextNoteEvent ||
noteEvent is ClassifiedsEvent || noteEvent is ClassifiedsEvent ||