1
0
mirror of https://github.com/golang/go synced 2024-11-14 13:10:21 -07:00

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>
This commit is contained in:
Tobias Klauser 2024-10-08 13:12:12 +02:00 committed by Gopher Robot
parent 5923a97f43
commit dd281fd616

View File

@ -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 {