cleanup: address ifshort linter issues

This commit addresses ifshort linter issues which
checks if short syntax for if-statements is possible.

updates: #1586

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R
2021-05-06 15:19:27 +05:30
committed by mergify[bot]
parent 6618e2012d
commit b891e5585d
9 changed files with 10 additions and 19 deletions

View File

@ -156,8 +156,7 @@ func (cp *ConnPool) Get(monitors, user, keyfile string) (*rados.Conn, error) {
cp.lock.Lock()
defer cp.lock.Unlock()
oldConn := cp.getConn(unique)
if oldConn != nil {
if oldConn := cp.getConn(unique); oldConn != nil {
// there was a race, oldConn already exists
ce.destroy()
return oldConn, nil