We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
perf improvement
1 parent e52b7d8 commit 69b1b20Copy full SHA for 69b1b20
library/src/main/java/dev/olog/contentresolversql/ContentResolverExtension.kt
@@ -125,9 +125,11 @@ fun ContentResolver.querySql2(
125
}
126
127
128
-internal fun createKeywords(query: String): List<Pair<String, Int>> {
129
- return keywords.map { it to query.indexOf(it, ignoreCase = true) }
+internal inline fun createKeywords(query: String): List<Pair<String, Int>> {
+ return keywords.asSequence()
130
+ .map { it to query.indexOf(it, ignoreCase = true) }
131
.filter { it.second > -1 }
132
+ .toList()
133
134
135
internal inline fun sanitize(keywords: List<Pair<String, Int>>) {
0 commit comments