From bedda245740d766bfad36b2d91a22781575fe463 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 15 Mar 2024 07:33:32 +0000 Subject: [PATCH] cmd/internal/obj: replace bytes.Index call with bytes.Contains Change-Id: I6b30ac3e9d15c29197426fb16dc4031056f6bb10 GitHub-Last-Rev: e2dda286f26587726870a5779d6caa0c5abd6750 GitHub-Pull-Request: golang/go#66331 Reviewed-on: https://go-review.googlesource.com/c/go/+/571915 Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui --- src/cmd/internal/obj/x86/pcrelative_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/internal/obj/x86/pcrelative_test.go b/src/cmd/internal/obj/x86/pcrelative_test.go index 3827100123..f92b43c72f 100644 --- a/src/cmd/internal/obj/x86/pcrelative_test.go +++ b/src/cmd/internal/obj/x86/pcrelative_test.go @@ -93,7 +93,7 @@ LOOP: data := bytes.Split(objout, []byte("\n")) for idx := len(data) - 1; idx >= 0; idx-- { // check that RET wasn't overwritten. - if bytes.Index(data[idx], []byte("RET")) != -1 { + if bytes.Contains(data[idx], []byte("RET")) { if testing.Short() { break LOOP } -- 2.50.0