mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: add Nodes.Set1 method and use it where possible
Passes toolstash -cmp. Change-Id: I05322fb5afd213f13fb247ec1a5f655c17a58774 Reviewed-on: https://go-review.googlesource.com/20522 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
72655afb4e
commit
c63dbd87c1
15 changed files with 63 additions and 54 deletions
|
|
@ -411,6 +411,11 @@ func (n *Nodes) Set(s []*Node) {
|
|||
}
|
||||
}
|
||||
|
||||
// Set1 sets n to a slice containing a single node.
|
||||
func (n *Nodes) Set1(node *Node) {
|
||||
n.slice = &[]*Node{node}
|
||||
}
|
||||
|
||||
// MoveNodes sets n to the contents of n2, then clears n2.
|
||||
func (n *Nodes) MoveNodes(n2 *Nodes) {
|
||||
n.slice = n2.slice
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue