diff options
| author | cuishuang <imcusg@gmail.com> | 2025-03-31 18:10:43 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-04-07 12:59:28 -0700 |
| commit | 465097b2b5f9d8178fafac8a85a3cd331758b643 (patch) | |
| tree | 84ffd2f265d4561584662e0bdb1b3fe8cb0cc2b6 /src/net | |
| parent | d584d2b3dda9ab88a51a3e9cffe8ecd140479cef (diff) | |
| download | go-465097b2b5f9d8178fafac8a85a3cd331758b643.tar.xz | |
all: use built-in max/min to simplify the code
Change-Id: I309d93d6ebf0feb462217a344d5f02c190220752
Reviewed-on: https://go-review.googlesource.com/c/go/+/661737
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/timeout_test.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/net/timeout_test.go b/src/net/timeout_test.go index 09adb9bdca..0d009f6999 100644 --- a/src/net/timeout_test.go +++ b/src/net/timeout_test.go @@ -730,10 +730,7 @@ func nextTimeout(actual time.Duration) (next time.Duration, ok bool) { // duration by any significant margin. Try the next attempt with an arbitrary // factor above that, so that our growth curve is at least exponential. next = actual * 5 / 4 - if next > maxDynamicTimeout { - return maxDynamicTimeout, true - } - return next, true + return min(next, maxDynamicTimeout), true } // There is a very similar copy of this in os/timeout_test.go. |
