mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 09:13:09 -06:00
Make slice on creation
This commit is contained in:
parent
0d3a6e1c37
commit
63bba0661f
|
|
@ -41,11 +41,10 @@ var allowedPresence = map[string]bool{
|
||||||
"offline": true,
|
"offline": true,
|
||||||
"unavailable": true,
|
"unavailable": true,
|
||||||
}
|
}
|
||||||
var allowedStrings []string
|
var allowedStrings = make([]string, len(allowedPresence))
|
||||||
|
|
||||||
// we only need to do this once
|
// we only need to do this once
|
||||||
func init() {
|
func init() {
|
||||||
allowedStrings = make([]string, len(allowedPresence))
|
|
||||||
i := 0
|
i := 0
|
||||||
for k := range allowedPresence {
|
for k := range allowedPresence {
|
||||||
allowedStrings[i] = k
|
allowedStrings[i] = k
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue