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
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
2 changed files with 8 additions and 6 deletions

2
.idea/kotlinc.xml generated
View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="2.0.20" />
<option name="version" value="2.0.21" />
</component>
</project>

View File

@ -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)