aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/mvs/mvs.go
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2024-03-26 22:59:41 +0200
committerDaniel Martí <mvdan@mvdan.cc>2024-03-27 21:58:12 +0000
commit2e1003e2f7e42efc5771812b9ee6ed264803796c (patch)
tree1e70949071ddcf3eb2e63386e36d6083556a57c8 /src/cmd/go/internal/mvs/mvs.go
parent0c5612092deb0a50c5a3d67babc1249049595558 (diff)
downloadgo-2e1003e2f7e42efc5771812b9ee6ed264803796c.tar.gz
go-2e1003e2f7e42efc5771812b9ee6ed264803796c.zip
cmd/go: replace reflect.DeepEqual with slices.Equal and maps.Equal
All of these maps and slices are made up of comparable types, so we can avoid the overhead of reflection entirely. Change-Id: If77dbe648a336ba729c171e84c9ff3f7e160297d Reviewed-on: https://go-review.googlesource.com/c/go/+/574597 Reviewed-by: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/cmd/go/internal/mvs/mvs.go')
-rw-r--r--src/cmd/go/internal/mvs/mvs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/go/internal/mvs/mvs.go b/src/cmd/go/internal/mvs/mvs.go
index 468a985927..1ac5aeb471 100644
--- a/src/cmd/go/internal/mvs/mvs.go
+++ b/src/cmd/go/internal/mvs/mvs.go
@@ -8,7 +8,7 @@ package mvs
import (
"fmt"
- "reflect"
+ "slices"
"sort"
"sync"
@@ -171,7 +171,7 @@ func buildList(targets []module.Version, reqs Reqs, upgrade func(module.Version)
// The final list is the minimum version of each module found in the graph.
list := g.BuildList()
- if vs := list[:len(targets)]; !reflect.DeepEqual(vs, targets) {
+ if vs := list[:len(targets)]; !slices.Equal(vs, targets) {
// target.Version will be "" for modload, the main client of MVS.
// "" denotes the main module, which has no version. However, MVS treats
// version strings as opaque, so "" is not a special value here.