From 33812f766691a1246a4f2b7d8e22e0a7d71630e9 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Wed, 23 Dec 2015 18:44:09 +0000 Subject: [PATCH] tiny refactor: rename --- mesh/gossip_channel.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mesh/gossip_channel.go b/mesh/gossip_channel.go index c20a7963..ff08e815 100644 --- a/mesh/gossip_channel.go +++ b/mesh/gossip_channel.go @@ -178,11 +178,11 @@ func (c *GossipChannel) SendDown(conn Connection, data GossipData) { c.sendDown([]Connection{conn}, data) } -func (c *GossipChannel) sendDown(selectedConnections []Connection, data GossipData) { - if len(selectedConnections) == 0 { +func (c *GossipChannel) sendDown(conns []Connection, data GossipData) { + if len(conns) == 0 { return } - connections := c.ourself.Connections() + ourConnections := c.ourself.Connections() c.Lock() defer c.Unlock() // GC - randomly (courtesy of go's map iterator) pick some @@ -197,7 +197,7 @@ func (c *GossipChannel) sendDown(selectedConnections []Connection, data GossipDa // we operate on LocalPeer.Connections(). That is // O(n_our_connections) at best. for conn, sender := range c.senders { - if _, found := connections[conn]; !found { + if _, found := ourConnections[conn]; !found { delete(c.senders, conn) sender.Stop() } else { @@ -205,7 +205,7 @@ func (c *GossipChannel) sendDown(selectedConnections []Connection, data GossipDa } } // start senders, if necessary, and send. - for _, conn := range selectedConnections { + for _, conn := range conns { sender, found := c.senders[conn] if !found { sender = c.makeSender(conn)