From 26f87139e0e5656f735925d5706b75ee978bbbca Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Mon, 21 Jul 2014 21:04:28 -0400 Subject: [PATCH] remove needless ipv6 checks --- tracker/announce.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tracker/announce.go b/tracker/announce.go index 6b6fbbe..634cee6 100644 --- a/tracker/announce.go +++ b/tracker/announce.go @@ -122,7 +122,7 @@ func updateSwarm(c Conn, ann *models.Announce, p *models.Peer, t *models.Torrent t.Seeders[p.ID] = *p if p.IPv4() { stats.RecordEvent(stats.NewSeedIPv4) - } else if p.IPv6() { + } else { stats.RecordEvent(stats.NewSeedIPv6) } @@ -134,7 +134,7 @@ func updateSwarm(c Conn, ann *models.Announce, p *models.Peer, t *models.Torrent t.Leechers[p.ID] = *p if p.IPv4() { stats.RecordEvent(stats.NewLeechIPv4) - } else if p.IPv6() { + } else { stats.RecordEvent(stats.NewLeechIPv6) } } @@ -157,7 +157,7 @@ func handleEvent(c Conn, ann *models.Announce, p *models.Peer, u *models.User, t delete(t.Seeders, p.ID) if p.IPv4() { stats.RecordEvent(stats.DeletedSeedIPv4) - } else if p.IPv6() { + } else { stats.RecordEvent(stats.DeletedSeedIPv6) } @@ -169,7 +169,7 @@ func handleEvent(c Conn, ann *models.Announce, p *models.Peer, u *models.User, t delete(t.Leechers, p.ID) if p.IPv4() { stats.RecordEvent(stats.DeletedLeechIPv4) - } else if p.IPv6() { + } else { stats.RecordEvent(stats.DeletedLeechIPv6) } } @@ -198,7 +198,7 @@ func handleEvent(c Conn, ann *models.Announce, p *models.Peer, u *models.User, t snatched = true if p.IPv4() { stats.RecordEvent(stats.CompletedIPv4) - } else if p.IPv6() { + } else { stats.RecordEvent(stats.CompletedIPv6) }