From: Cuong Manh Le Date: Wed, 4 Sep 2024 17:38:06 +0000 (+0700) Subject: cmd/compile: remove NameSet.Sorted X-Git-Tag: go1.24rc1~1013 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d6d5d8c8fbe574349422b444a8cf0ff0647a6dcf;p=gostls13.git cmd/compile: remove NameSet.Sorted The only usage of it was removed in CL 517617 Change-Id: If1898b7cde4f8c7ab906a2c27a01125415b463c3 Reviewed-on: https://go-review.googlesource.com/c/go/+/610600 Auto-Submit: Cuong Manh Le Reviewed-by: Cherry Mui Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI --- diff --git a/src/cmd/compile/internal/ir/node.go b/src/cmd/compile/internal/ir/node.go index acdd47d219..4f5ad53d63 100644 --- a/src/cmd/compile/internal/ir/node.go +++ b/src/cmd/compile/internal/ir/node.go @@ -9,7 +9,6 @@ package ir import ( "fmt" "go/constant" - "sort" "cmd/compile/internal/base" "cmd/compile/internal/types" @@ -429,16 +428,6 @@ func (s *NameSet) Add(n *Name) { (*s)[n] = struct{}{} } -// Sorted returns s sorted according to less. -func (s NameSet) Sorted(less func(*Name, *Name) bool) []*Name { - var res []*Name - for n := range s { - res = append(res, n) - } - sort.Slice(res, func(i, j int) bool { return less(res[i], res[j]) }) - return res -} - type PragmaFlag uint16 const (