Skip to content

Commit efb25c7

Browse files
gnpricechrisbobbe
authored andcommitted
content [nfc]: Use non-capturing group in _emojiClassRegexp
We never look at the captured group, so it's more efficient to not ask the regexp engine to capture it in the first place.
1 parent 4a10b3c commit efb25c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/model/content.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ class _ZulipContentParser {
639639
return RegExp("^(?:$mentionClass(?: silent)?|silent $mentionClass)\$");
640640
}();
641641

642-
static final _emojiClassRegexp = RegExp(r"^emoji(-[0-9a-f]+)*$");
642+
static final _emojiClassRegexp = RegExp(r"^emoji(?:-[0-9a-f]+)*$");
643643

644644
InlineContentNode parseInlineContent(dom.Node node) {
645645
assert(_debugParserContext == _ParserContext.inline);

0 commit comments

Comments
 (0)