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()) {
|
||||
apps
|
||||
} 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())
|
||||
|
||||
|
|
|
@ -202,13 +202,14 @@ class HomeVm @Inject constructor() : ViewModel() {
|
|||
appInfos
|
||||
}
|
||||
}
|
||||
}.combine(debounceSearchStrFlow) { appInfos, debounceSearchStr ->
|
||||
if (debounceSearchStr.isBlank()) {
|
||||
}.combine(debounceSearchStrFlow) { appInfos, str ->
|
||||
if (str.isBlank()) {
|
||||
appInfos
|
||||
} 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(
|
||||
debounceSearchStr
|
||||
str,
|
||||
true
|
||||
)
|
||||
}).distinct()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user