瀏覽代碼

chore: slice replace loop (#3410)

guangwu 1 年之前
父節點
當前提交
f1171e01f2
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      tools/goctl/pkg/parser/api/ast/writer.go

+ 1 - 3
tools/goctl/pkg/parser/api/ast/writer.go

@@ -219,9 +219,7 @@ func transferTokenNode(node *TokenNode, opt ...tokenNodeOption) *TokenNode {
 		}
 		}
 	}
 	}
 	if !option.ignoreLeadingComment {
 	if !option.ignoreLeadingComment {
-		for _, v := range node.LeadingCommentGroup {
-			result.LeadingCommentGroup = append(result.LeadingCommentGroup, v)
-		}
+		result.LeadingCommentGroup = append(result.LeadingCommentGroup, node.LeadingCommentGroup...)
 	}
 	}
 	return result
 	return result
 }
 }