emoji_picker: Convert _.any used as loop to for…of.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2020-02-07 20:13:43 -08:00 committed by Tim Abbott
parent 2f314a0854
commit 4fbee73d1a
1 changed files with 3 additions and 3 deletions

View File

@ -216,15 +216,15 @@ function filter_emojis() {
const emojis = category.emojis;
for (const emoji_dict of emojis) {
_.any(emoji_dict.aliases, function (alias) {
for (const alias of emoji_dict.aliases) {
const match = _.every(search_terms, function (search_term) {
return alias.indexOf(search_term) >= 0;
});
if (match) {
search_results.push(_.extend({}, emoji_dict, {name: alias}));
return true;
break; // We only need the first matching alias per emoji.
}
});
}
}
}