[optimisation] Avoid making a pointless arraylist in 90% of cases.

This commit is contained in:
Reinier Zwitserloot committed 2025-08-07 02:03:00 +02:00
1 parent 7aa264ea6a
commit 1255ae0d39
1 file changed
+2 -1
+2 -1
View File
@@ -403,8 +403,9 @@ public class EclipseAST extends AST<EclipseAST, EclipseNode, ASTNode> {
}
private Collection<EclipseNode> buildRecordComponents(AbstractVariableDeclaration[] children) {
if (children == null) return Collections.emptyList();
List<EclipseNode> childNodes = new ArrayList<EclipseNode>();
if (children != null) for (int i = 0; i < children.length; i++) {
for (int i = 0; i < children.length; i++) {
addIfNotNull(childNodes, buildRecordComponent(children[i]));
}
return childNodes;