PollerMap.deviceIDs: use zero-inited string slice

This commit is contained in:
David Robertson 2023-07-27 12:01:06 +01:00
parent 14113e215f
commit 6c81134056
No known key found for this signature in database
GPG Key ID: 903ECE108A39DEDD

View File

@ -204,7 +204,7 @@ func (h *PollerMap) NumPollers() (count int) {
func (h *PollerMap) deviceIDs(userID string) []string {
h.pollerMu.Lock()
defer h.pollerMu.Unlock()
devices := make([]string, 0)
var devices []string
for _, p := range h.Pollers {
if !p.terminated.Load() && p.userID == userID {
devices = append(devices, p.deviceID)