Possibly make app search a bit faster again

This commit is contained in:
MM20
2024-10-20 12:04:42 +02:00
parent 80b9783729
commit 2a772e8f6d
2 changed files with 8 additions and 6 deletions
@@ -247,12 +247,14 @@ internal class AppRepositoryImpl(
appResults.addAll(apps)
} else {
appResults.addAll(apps.mapNotNull {
val score = ResultScore(
query = query,
primaryFields = listOf(it.label),
)
if (score.score < 0.8f) return@mapNotNull null
it.copy(
score = ResultScore(
query = query,
primaryFields = listOf(it.label),
)
).takeIf { it.score.score >= 0.8f }
score = score
)
})
val componentName = ComponentName.unflattenFromString(query)