From: guoguangwu Date: Fri, 15 Mar 2024 07:33:32 +0000 (+0000) Subject: cmd/internal/obj: replace bytes.Index call with bytes.Contains X-Git-Tag: go1.23rc1~861 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bedda245740d766bfad36b2d91a22781575fe463;p=gostls13.git 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 --- 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 }