mirror of
https://github.com/golang/go
synced 2024-11-18 09:54:57 -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 {
|
if db.maxLifetime <= 0 {
|
||||||
return db.maxIdleTime
|
return db.maxIdleTime
|
||||||
}
|
}
|
||||||
|
return min(db.maxIdleTime, db.maxLifetime)
|
||||||
min := db.maxIdleTime
|
|
||||||
if min > db.maxLifetime {
|
|
||||||
min = db.maxLifetime
|
|
||||||
}
|
|
||||||
return min
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetMaxIdleConns sets the maximum number of connections in the idle
|
// SetMaxIdleConns sets the maximum number of connections in the idle
|
||||||
|
Loading…
Reference in New Issue
Block a user