Remove unused unnamed second item in ranges

This commit is contained in:
Bryan Boreham committed 2015-03-26 18:04:57 +00:00
1 parent 15fdcae25a
commit 7a4a88aeb9
4 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ func TestUDPDNSServer(t *testing.T) {
m.Answer[0] = &dns.MX{Hdr: dns.RR_Header{Name: m.Question[0].Name, Rrtype: dns.TypeMX, Class: dns.ClassINET, Ttl: 0}, Mx: "mail." + nonLocalName} m.Answer[0] = &dns.MX{Hdr: dns.RR_Header{Name: m.Question[0].Name, Rrtype: dns.TypeMX, Class: dns.ClassINET, Ttl: 0}, Mx: "mail." + nonLocalName}
} else if q.Name == nonLocalName && q.Qtype == dns.TypeANY { } else if q.Name == nonLocalName && q.Qtype == dns.TypeANY {
m.Answer = make([]dns.RR, 512/len("mailn."+nonLocalName)+1) m.Answer = make([]dns.RR, 512/len("mailn."+nonLocalName)+1)
for i, _ := range m.Answer { for i := range m.Answer {
m.Answer[i] = &dns.MX{Hdr: dns.RR_Header{Name: m.Question[0].Name, Rrtype: dns.TypeMX, Class: dns.ClassINET, Ttl: 0}, Mx: fmt.Sprintf("mail%d.%s", i, nonLocalName)} m.Answer[i] = &dns.MX{Hdr: dns.RR_Header{Name: m.Question[0].Name, Rrtype: dns.TypeMX, Class: dns.ClassINET, Ttl: 0}, Mx: fmt.Sprintf("mail%d.%s", i, nonLocalName)}
} }
} else if q.Name == testRDNSnonlocal && q.Qtype == dns.TypePTR { } else if q.Name == testRDNSnonlocal && q.Qtype == dns.TypePTR {
+1 -1
View File
@@ -119,7 +119,7 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections() time.Duration {
} }
// Add command-line targets that are not connected // Add command-line targets that are not connected
for address, _ := range cm.cmdLineAddress { for address := range cm.cmdLineAddress {
addTarget(address) addTarget(address)
} }
+2 -2
View File
@@ -107,7 +107,7 @@ func (peers *Peers) Names() PeerNameSet {
func (peers *Peers) EncodePeers(names PeerNameSet) []byte { func (peers *Peers) EncodePeers(names PeerNameSet) []byte {
peers.RLock() peers.RLock()
peerList := make([]*Peer, 0, len(names)) peerList := make([]*Peer, 0, len(names))
for name, _ := range names { for name := range names {
if peer, found := peers.table[name]; found { if peer, found := peers.table[name]; found {
peerList = append(peerList, peer) peerList = append(peerList, peer)
} }
@@ -169,7 +169,7 @@ func (peers *Peers) garbageCollect() []*Peer {
func setFromPeersMap(peers map[PeerName]*Peer) PeerNameSet { func setFromPeersMap(peers map[PeerName]*Peer) PeerNameSet {
names := make(PeerNameSet) names := make(PeerNameSet)
for name, _ := range peers { for name := range peers {
names[name] = true names[name] = true
} }
return names return names
+1 -1
View File
@@ -377,7 +377,7 @@ func NewTopologyGossipData(peers *Peers, update ...*Peer) *TopologyGossipData {
} }
func (d *TopologyGossipData) Merge(other GossipData) { func (d *TopologyGossipData) Merge(other GossipData) {
for name, _ := range other.(*TopologyGossipData).update { for name := range other.(*TopologyGossipData).update {
d.update[name] = true d.update[name] = true
} }
} }