This commit is contained in:
Vladimir Stoilov
2022-09-20 11:23:21 +02:00
committed by Daniel
parent b4e2687884
commit ddfa3722be
7 changed files with 64 additions and 57 deletions

View File

@@ -48,18 +48,15 @@ func (cs *connectionStore) clone() map[string]*Connection {
return m
}
func (cs *connectionStore) keys() []string {
func (cs *connectionStore) list() []*Connection {
cs.rw.RLock()
defer cs.rw.RUnlock()
keys := make([]string, len(cs.items))
i := 0
for key := range cs.items {
keys[i] = key
i++
l := []*Connection{}
for _, conn := range cs.items {
l = append(l, conn)
}
return keys
return l
}
func (cs *connectionStore) len() int { //nolint:unused // TODO: Clean up if still unused.