mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 03:32:38 +08:00
perf: search ignoreCase (#579)
This commit is contained in:
parent
679513b1aa
commit
517bfb49fe
|
@ -77,7 +77,12 @@ class GlobalRuleExcludeVm @Inject constructor(stateHandle: SavedStateHandle) : V
|
||||||
if (str.isBlank()) {
|
if (str.isBlank()) {
|
||||||
apps
|
apps
|
||||||
} else {
|
} else {
|
||||||
(apps.filter { a -> a.name.contains(str) } + apps.filter { a -> a.id.contains(str) }).distinct()
|
(apps.filter { a -> a.name.contains(str, true) } + apps.filter { a ->
|
||||||
|
a.id.contains(
|
||||||
|
str,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
}).distinct()
|
||||||
}
|
}
|
||||||
}.stateIn(viewModelScope, SharingStarted.Eagerly, emptyList())
|
}.stateIn(viewModelScope, SharingStarted.Eagerly, emptyList())
|
||||||
|
|
||||||
|
|
|
@ -202,13 +202,14 @@ class HomeVm @Inject constructor() : ViewModel() {
|
||||||
appInfos
|
appInfos
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.combine(debounceSearchStrFlow) { appInfos, debounceSearchStr ->
|
}.combine(debounceSearchStrFlow) { appInfos, str ->
|
||||||
if (debounceSearchStr.isBlank()) {
|
if (str.isBlank()) {
|
||||||
appInfos
|
appInfos
|
||||||
} else {
|
} else {
|
||||||
(appInfos.filter { a -> a.name.contains(debounceSearchStr) } + appInfos.filter { a ->
|
(appInfos.filter { a -> a.name.contains(str, true) } + appInfos.filter { a ->
|
||||||
a.id.contains(
|
a.id.contains(
|
||||||
debounceSearchStr
|
str,
|
||||||
|
true
|
||||||
)
|
)
|
||||||
}).distinct()
|
}).distinct()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user