diff --git a/controllers/admin/viewers.go b/controllers/admin/viewers.go index e2f48b1c1..ed542a31a 100644 --- a/controllers/admin/viewers.go +++ b/controllers/admin/viewers.go @@ -37,7 +37,7 @@ func GetViewersOverTime(w http.ResponseWriter, r *http.Request) { // GetActiveViewers returns currently connected clients. func GetActiveViewers(w http.ResponseWriter, r *http.Request) { c := core.GetActiveViewers() - viewers := []models.Viewer{} + viewers := make([]models.Viewer, 0, len(c)) for _, v := range c { viewers = append(viewers, *v) }