perf(frontend): emojilistのサイズ削減

This commit is contained in:
syuilo 2023-05-30 11:18:40 +09:00
parent f551b6d15e
commit dc031b1d07
4 changed files with 1792 additions and 1817 deletions

View file

@ -232,9 +232,9 @@ watch(q, () => {
}
if (matches.size >= max) return matches;
//
//
for (const emoji of emojis) {
if (keywords.every(keyword => emoji.name.includes(keyword) || emoji.keywords.some(alias => alias.includes(keyword)))) {
if (keywords.every(keyword => emoji.name.includes(keyword))) {
matches.add(emoji);
if (matches.size >= max) break;
}
@ -248,14 +248,6 @@ watch(q, () => {
}
if (matches.size >= max) return matches;
for (const emoji of emojis) {
if (emoji.keywords.some(keyword => keyword.startsWith(newQ))) {
matches.add(emoji);
if (matches.size >= max) break;
}
}
if (matches.size >= max) return matches;
for (const emoji of emojis) {
if (emoji.name.includes(newQ)) {
matches.add(emoji);
@ -263,13 +255,6 @@ watch(q, () => {
}
}
if (matches.size >= max) return matches;
for (const emoji of emojis) {
if (emoji.keywords.some(keyword => keyword.includes(newQ))) {
matches.add(emoji);
if (matches.size >= max) break;
}
}
}
return matches;