mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: remove nodesOrNodeListPtr outside of syntax.go
Passes toolstash -cmp. Update #14473. Change-Id: I2620374b79c61b1e48467b98afe2d7d3beef878b Reviewed-on: https://go-review.googlesource.com/20354 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
beabd872f4
commit
e28a890d5e
8 changed files with 214 additions and 212 deletions
|
|
@ -466,6 +466,18 @@ func (n *Nodes) Append(a ...*Node) {
|
|||
}
|
||||
}
|
||||
|
||||
// AppendNodes appends the contents of *n2 to n, then clears n2.
|
||||
func (n *Nodes) AppendNodes(n2 *Nodes) {
|
||||
switch {
|
||||
case n2.slice == nil:
|
||||
case n.slice == nil:
|
||||
n.slice = n2.slice
|
||||
default:
|
||||
*n.slice = append(*n.slice, *n2.slice...)
|
||||
}
|
||||
n2.slice = nil
|
||||
}
|
||||
|
||||
// SetToNodeList sets Nodes to the contents of a NodeList.
|
||||
func (n *Nodes) SetToNodeList(l *NodeList) {
|
||||
s := make([]*Node, 0, count(l))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue