From 6d16afc65c8c2dc69af478f90c236fa195f8a4ac Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Tue, 27 Mar 2018 10:59:42 -0500 Subject: [PATCH] Remove unnecessary nil checks --- agent/consul/server.go | 3 --- agent/router/router.go | 3 --- 2 files changed, 6 deletions(-) diff --git a/agent/consul/server.go b/agent/consul/server.go index fa633a4ef..764563d2f 100644 --- a/agent/consul/server.go +++ b/agent/consul/server.go @@ -888,9 +888,6 @@ func (s *Server) KeyManagerLAN() *serf.KeyManager { // KeyManagerWAN returns the WAN Serf keyring manager func (s *Server) KeyManagerWAN() *serf.KeyManager { - if s.serfWAN == nil { - return nil - } return s.serfWAN.KeyManager() } diff --git a/agent/router/router.go b/agent/router/router.go index f811a6c33..426ca1628 100644 --- a/agent/router/router.go +++ b/agent/router/router.go @@ -116,9 +116,6 @@ func (r *Router) Shutdown() { // AddArea registers a new network area with the router. func (r *Router) AddArea(areaID types.AreaID, cluster RouterSerfCluster, pinger Pinger, useTLS bool) error { - if cluster == nil { - return nil - } r.Lock() defer r.Unlock()