Skip to content

Commit f5ea575

Browse files
cuishuangfindleyr
authored andcommitted
go/ssa/interp: use slices.Equal to simplify code
Change-Id: Ia479b7ef55acad189ae8cc0846780cbdc41b2298 Reviewed-on: https://go-review.googlesource.com/c/tools/+/675517 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
1 parent 6e44d1e commit f5ea575

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

go/ssa/interp/external.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"math"
1414
"os"
1515
"runtime"
16+
"slices"
1617
"sort"
1718
"strconv"
1819
"strings"
@@ -119,15 +120,7 @@ func ext۰bytes۰Equal(fr *frame, args []value) value {
119120
// func Equal(a, b []byte) bool
120121
a := args[0].([]value)
121122
b := args[1].([]value)
122-
if len(a) != len(b) {
123-
return false
124-
}
125-
for i := range a {
126-
if a[i] != b[i] {
127-
return false
128-
}
129-
}
130-
return true
123+
return slices.Equal(a, b)
131124
}
132125

133126
func ext۰bytes۰IndexByte(fr *frame, args []value) value {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy