From 42fb764e96842b555177d841eb3a98cf09e36f7a Mon Sep 17 00:00:00 2001 From: guangwu Date: Tue, 25 Jul 2023 17:30:07 +0800 Subject: [PATCH] chore: replace loop with n.Values = append(n.Values, target.Values...) (#380) --- ast/ast.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ast/ast.go b/ast/ast.go index f535a24..b4d5ec4 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -1506,9 +1506,7 @@ func (n *SequenceNode) Replace(idx int, value Node) error { func (n *SequenceNode) Merge(target *SequenceNode) { column := n.Start.Position.Column - target.Start.Position.Column target.AddColumn(column) - for _, value := range target.Values { - n.Values = append(n.Values, value) - } + n.Values = append(n.Values, target.Values...) } // SetIsFlowStyle set value to IsFlowStyle field recursively.