refactor: make Peer.Connections() return a set instead of a slice

This is more flexible since it allows callers to perform efficient
lookups on the result.
This commit is contained in:
Matthias Radestock committed 2015-04-06 13:57:13 +01:00
1 parent fe4d8b7767
commit 9b9d8a03aa
6 files changed
+16 -9

No files matched your search

+1 -1
View File
@@ -179,7 +179,7 @@ func (c *GossipChannel) Send(data GossipData) {
retainedSenders := make(connectionSenders)
c.Lock()
defer c.Unlock()
for _, conn := range connections {
for conn := range connections {
c.sendDown(conn, data)
retainedSenders[conn] = c.senders[conn]
delete(c.senders, conn)