Explorar o código

Removed redundant Boolean == checks in if

Ben Frye %!s(int64=11) %!d(string=hai) anos
pai
achega
a3fe3be866
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      cluster.go

+ 2 - 2
cluster.go

@@ -63,7 +63,7 @@ func (cfg *ClusterConfig) CreateSession() (*Session, error) {
 		s := NewSession(pool, *cfg)
 		s.SetConsistency(cfg.Consistency)
 
-		if cfg.DiscoverHosts == true {
+		if cfg.DiscoverHosts {
 			//Fill out cfg.Hosts
 			query := "SELECT peer FROM system.peers"
 			peers := s.Query(query).Iter()
@@ -76,7 +76,7 @@ func (cfg *ClusterConfig) CreateSession() (*Session, error) {
 						exists = true
 					}
 				}
-				if exists == false{
+				if !exists{
 					cfg.Hosts = append(cfg.Hosts, ip)
 				}
 			}