]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj: replace bytes.Index call with bytes.Contains
authorguoguangwu <guoguangwug@gmail.com>
Fri, 15 Mar 2024 07:33:32 +0000 (07:33 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 15 Mar 2024 23:16:01 +0000 (23:16 +0000)
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 <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/internal/obj/x86/pcrelative_test.go

index 3827100123f26d874a30239bff703111e5006fb6..f92b43c72f1413c425cb0d1d04636d603297cb36 100644 (file)
@@ -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
                                }