forked from quic-go/quic-go
utils: use time.Duration.Abs (#4217)
This function was added in Go 1.19, and covers some corner cases that our custom implementation didn't.
This commit is contained in:
@@ -35,14 +35,6 @@ func MinNonZeroDuration(a, b time.Duration) time.Duration {
|
||||
return Min(a, b)
|
||||
}
|
||||
|
||||
// AbsDuration returns the absolute value of a time duration
|
||||
func AbsDuration(d time.Duration) time.Duration {
|
||||
if d >= 0 {
|
||||
return d
|
||||
}
|
||||
return -d
|
||||
}
|
||||
|
||||
// MinTime returns the earlier time
|
||||
func MinTime(a, b time.Time) time.Time {
|
||||
if a.After(b) {
|
||||
|
||||
Reference in New Issue
Block a user