Skip to content

Commit ab50a5d

Browse files
committed
emoji: Short-circuit matching an empty query
This is NFC except for performance. This is an extremely common case -- it happens every time the user opens the emoji picker, and applies to every emoji -- so worth optimizing.
1 parent 906545f commit ab50a5d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/model/emoji.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ class EmojiAutocompleteQuery extends ComposeAutocompleteQuery {
364364

365365
// Compare get_emoji_matcher in Zulip web:shared/src/typeahead.ts .
366366
bool matches(EmojiCandidate candidate) {
367+
if (_adjusted == '') return true;
367368
if (candidate.emojiDisplay case UnicodeEmojiDisplay(:var emojiUnicode)) {
368369
if (_adjusted == emojiUnicode) return true;
369370
}

0 commit comments

Comments
 (0)