From 13e5448c1746b09b08d7a11db01192ff93ec87fb Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 24 Jun 2021 14:32:30 -0400 Subject: [PATCH] tlsutil: remove unnecessary getter functions These functions did nothing but hide the fields they were returning. --- tlsutil/config.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tlsutil/config.go b/tlsutil/config.go index 4d493e3cee..7c661c9408 100644 --- a/tlsutil/config.go +++ b/tlsutil/config.go @@ -394,19 +394,11 @@ func validateConfig(config Config, pool *x509.CertPool, cert *tls.Certificate) e } func (c Config) anyVerifyIncoming() bool { - return c.baseVerifyIncoming() || c.VerifyIncomingRPC || c.VerifyIncomingHTTPS + return c.VerifyIncoming || c.VerifyIncomingRPC || c.VerifyIncomingHTTPS } func (c Config) verifyIncomingRPC() bool { - return c.baseVerifyIncoming() || c.VerifyIncomingRPC -} - -func (c Config) verifyIncomingHTTPS() bool { - return c.baseVerifyIncoming() || c.VerifyIncomingHTTPS -} - -func (c *Config) baseVerifyIncoming() bool { - return c.VerifyIncoming + return c.VerifyIncoming || c.VerifyIncomingRPC } func loadKeyPair(certFile, keyFile string) (*tls.Certificate, error) { @@ -616,7 +608,7 @@ func (c *Configurator) verifyIncomingRPC() bool { func (c *Configurator) verifyIncomingHTTPS() bool { c.lock.RLock() defer c.lock.RUnlock() - return c.base.verifyIncomingHTTPS() + return c.base.VerifyIncoming || c.base.VerifyIncomingHTTPS } // This function acquires a read lock because it reads from the config.