aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorMarcel Meyer <mm.marcelmeyer@gmail.com>2025-04-11 22:19:49 +0000
committerGopher Robot <gobot@golang.org>2025-04-11 16:00:30 -0700
commit03640f688b6ae069c72373d7aaa8d23784e456fc (patch)
treecf1e88173ae94fd309b3902f066313388c137031 /src/internal
parent56fad21c22ece03a3f1f059fa67d7593278eb5f4 (diff)
downloadgo-03640f688b6ae069c72373d7aaa8d23784e456fc.tar.xz
all: use built-in min, max functions
Change-Id: Ie76ebb556d635068342747f3f91dd7dc423df531 GitHub-Last-Rev: aea61fb3a054e6bd24f4684f90fb353d5682cd0b GitHub-Pull-Request: golang/go#73340 Reviewed-on: https://go-review.googlesource.com/c/go/+/664677 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/poll/copy_file_range_unix.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/internal/poll/copy_file_range_unix.go b/src/internal/poll/copy_file_range_unix.go
index d3d3aaeed1..d39c5a339d 100644
--- a/src/internal/poll/copy_file_range_unix.go
+++ b/src/internal/poll/copy_file_range_unix.go
@@ -16,10 +16,7 @@ func CopyFileRange(dst, src *FD, remain int64) (written int64, handled bool, err
}
for remain > 0 {
- max := remain
- if max > maxCopyFileRangeRound {
- max = maxCopyFileRangeRound
- }
+ max := min(remain, maxCopyFileRangeRound)
n, e := copyFileRange(dst, src, int(max))
if n > 0 {
remain -= n