Skip to content

Commit

Permalink
content [nfc]: Use non-capturing group in _emojiClassRegexp
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gnprice authored and chrisbobbe committed Feb 6, 2024
1 parent 4a10b3c commit efb25c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/model/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ class _ZulipContentParser {
return RegExp("^(?:$mentionClass(?: silent)?|silent $mentionClass)\$");
}();

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

InlineContentNode parseInlineContent(dom.Node node) {
assert(_debugParserContext == _ParserContext.inline);
Expand Down

0 comments on commit efb25c7

Please sign in to comment.