From 8730b939480bade76e4ad27b11ed920880d233a5 Mon Sep 17 00:00:00 2001 From: Benjamin Wenger <ben@elixxir.ioo> Date: Thu, 1 Sep 2022 09:25:52 -0700 Subject: [PATCH] made the emoji init code simpler --- channels/emoji.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/channels/emoji.go b/channels/emoji.go index 5cbc38152..fb25f1585 100644 --- a/channels/emoji.go +++ b/channels/emoji.go @@ -15,13 +15,7 @@ import ( //based on emojis found at https://unicode.org/emoji/charts/full-emoji-list.html const findEmoji = `[\xA9\xAE\x{2000}-\x{3300}\x{1F000}-\x{1FBFF}]` -var compiledRegex *regexp.Regexp - -// compile the regular expression in an init so it is only -// compiled once -func init() { - compiledRegex = regexp.MustCompile(findEmoji) -} +var compiledRegex = regexp.MustCompile(findEmoji) // ValidateReaction checks that the reaction only contains a single emoji. func ValidateReaction(reaction string) error { -- GitLab