From 63bba0661faee1b212a9017bded21d61ea8b5635 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Fri, 18 Jun 2021 22:12:21 +0200 Subject: [PATCH] Make slice on creation --- clientapi/routing/presence.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clientapi/routing/presence.go b/clientapi/routing/presence.go index a9cf26856..92ca9eb67 100644 --- a/clientapi/routing/presence.go +++ b/clientapi/routing/presence.go @@ -41,11 +41,10 @@ var allowedPresence = map[string]bool{ "offline": true, "unavailable": true, } -var allowedStrings []string +var allowedStrings = make([]string, len(allowedPresence)) // we only need to do this once func init() { - allowedStrings = make([]string, len(allowedPresence)) i := 0 for k := range allowedPresence { allowedStrings[i] = k