From 1255ae0d39f3b46da935f619dbba829868db3f36 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 7 Aug 2025 00:19:57 +0200 Subject: [PATCH] [optimisation] Avoid making a pointless arraylist in 90% of cases. --- src/core/lombok/eclipse/EclipseAST.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/lombok/eclipse/EclipseAST.java b/src/core/lombok/eclipse/EclipseAST.java index a7fa876f..dfe754a2 100644 --- a/src/core/lombok/eclipse/EclipseAST.java +++ b/src/core/lombok/eclipse/EclipseAST.java @@ -403,8 +403,9 @@ public class EclipseAST extends AST { } private Collection buildRecordComponents(AbstractVariableDeclaration[] children) { + if (children == null) return Collections.emptyList(); List childNodes = new ArrayList(); - 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;