mirror of
https://github.com/golang/go
synced 2024-11-18 10:04:43 -07:00
database/sql: use the built-in min function
This commit is contained in:
parent
451e4727ec
commit
dc82635562
@ -964,12 +964,7 @@ func (db *DB) shortestIdleTimeLocked() time.Duration {
|
||||
if db.maxLifetime <= 0 {
|
||||
return db.maxIdleTime
|
||||
}
|
||||
|
||||
min := db.maxIdleTime
|
||||
if min > db.maxLifetime {
|
||||
min = db.maxLifetime
|
||||
}
|
||||
return min
|
||||
return min(db.maxIdleTime, db.maxLifetime)
|
||||
}
|
||||
|
||||
// SetMaxIdleConns sets the maximum number of connections in the idle
|
||||
|
Loading…
Reference in New Issue
Block a user