Skip to content

Commit 1023683

Browse files
author
Andy
authored
Use 'append' helper more (#21125)
1 parent ddd8e75 commit 1023683

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/compiler/parser.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6603,10 +6603,7 @@ namespace ts {
66036603
const start = scanner.getStartPos();
66046604
let children: JSDocParameterTag[];
66056605
while (child = tryParse(() => parseChildParameterOrPropertyTag(PropertyLikeParse.Parameter, name))) {
6606-
if (!children) {
6607-
children = [];
6608-
}
6609-
children.push(child);
6606+
children = append(children, child);
66106607
}
66116608
if (children) {
66126609
jsdocTypeLiteral = <JSDocTypeLiteral>createNode(SyntaxKind.JSDocTypeLiteral, start);
@@ -6723,10 +6720,7 @@ namespace ts {
67236720
}
67246721
}
67256722
else {
6726-
if (!jsdocTypeLiteral.jsDocPropertyTags) {
6727-
jsdocTypeLiteral.jsDocPropertyTags = [] as MutableNodeArray<JSDocPropertyTag>;
6728-
}
6729-
(jsdocTypeLiteral.jsDocPropertyTags as MutableNodeArray<JSDocPropertyTag>).push(child);
6723+
jsdocTypeLiteral.jsDocPropertyTags = append(jsdocTypeLiteral.jsDocPropertyTags as MutableNodeArray<JSDocPropertyTag>, child);
67306724
}
67316725
}
67326726
if (jsdocTypeLiteral) {

0 commit comments

Comments
 (0)