aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/memmove_test.go
diff options
context:
space:
mode:
authorqiulaidongfeng <2645477756@qq.com>2023-10-10 12:43:40 +0000
committerKeith Randall <khr@golang.org>2023-10-24 20:28:25 +0000
commitb5f87b5407916c4049a3158cc944cebfd7a883a9 (patch)
tree64b4a4c47ee017cad96b8b908ba368ee966ecdf1 /src/runtime/memmove_test.go
parent9ab5121691ee0c4f32bf8d8c3c10c0e85a89ceb5 (diff)
downloadgo-b5f87b5407916c4049a3158cc944cebfd7a883a9.tar.xz
runtime: use max/min func
Change-Id: I3f0b7209621b39cee69566a5cc95e4343b4f1f20 GitHub-Last-Rev: af9dbbe69ad74e8c210254dafa260a886b690853 GitHub-Pull-Request: golang/go#63321 Reviewed-on: https://go-review.googlesource.com/c/go/+/531916 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/memmove_test.go')
-rw-r--r--src/runtime/memmove_test.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/runtime/memmove_test.go b/src/runtime/memmove_test.go
index 21236d19da..587e03d385 100644
--- a/src/runtime/memmove_test.go
+++ b/src/runtime/memmove_test.go
@@ -488,9 +488,7 @@ func BenchmarkMemclrRange(b *testing.B) {
maxLen := 0
for _, clrLen := range t.data {
- if clrLen > maxLen {
- maxLen = clrLen
- }
+ maxLen = max(maxLen, clrLen)
if clrLen < minLen || minLen == 0 {
minLen = clrLen
}