updated search algorithm to use previous search result to speed up when typing things out, eg

before
        "a": 47k -> 25k emojis
        "ab": 47k -> ~850
    after
        "a": 47k -> 25k
        "ab" 25k -> ~850
also sort search results
using a Task again
added a ui thingy for no downloaded emojis
This commit is contained in:
Nihaal Sharma committed 2026-03-20 18:08:26 +00:00
1 parent d64ca5cd42
commit 0c216bb800
4 files changed
+31 -15

No files matched your search

+7 -2
View File
@@ -42,12 +42,17 @@ class Trie: ObservableObject {
}
}
func search(for query: String) -> [String] {
func search(for query: String, previousQuery: String?, previousResult: Set<String>?) -> [String] {
var result: Set<String> = wordlist
if let previousQuery,
let previousResult,
query.hasPrefix(previousQuery) {
result = previousResult
}
for word in query.split(separator: " ") {
result = result.filter { $0.localizedCaseInsensitiveContains(word) }
}
return Array(result)
return Array(result).sorted()
}
func search(exactly query: String) -> Bool {
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.