diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2024-10-08 13:12:12 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-10-08 15:08:01 +0000 |
| commit | dd281fd616f2dd762826669dd52af37b1bb7fb83 (patch) | |
| tree | f45c41ac9540252d4fefa2c310cdc005aa809d90 /src/encoding | |
| parent | 5923a97f43bd7b8910fa69e3c02cdef2c531cdcf (diff) | |
| download | go-dd281fd616f2dd762826669dd52af37b1bb7fb83.tar.xz | |
encoding/asn1: use slices.Equal in ObjectIdentifier.Equal
Change-Id: I5efe3b9dcee85dfa34b6072c6f85108b6fc7cf99
Reviewed-on: https://go-review.googlesource.com/c/go/+/618515
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Diffstat (limited to 'src/encoding')
| -rw-r--r-- | src/encoding/asn1/asn1.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/encoding/asn1/asn1.go b/src/encoding/asn1/asn1.go index 56e007d3a6..488fb9b1e0 100644 --- a/src/encoding/asn1/asn1.go +++ b/src/encoding/asn1/asn1.go @@ -25,6 +25,7 @@ import ( "math" "math/big" "reflect" + "slices" "strconv" "strings" "time" @@ -224,16 +225,7 @@ type ObjectIdentifier []int // Equal reports whether oi and other represent the same identifier. func (oi ObjectIdentifier) Equal(other ObjectIdentifier) bool { - if len(oi) != len(other) { - return false - } - for i := 0; i < len(oi); i++ { - if oi[i] != other[i] { - return false - } - } - - return true + return slices.Equal(oi, other) } func (oi ObjectIdentifier) String() string { |
