Skip to content

Commit 1255ae0

Browse files
committed
[optimisation] Avoid making a pointless arraylist in 90% of cases.
1 parent 7aa264e commit 1255ae0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/core/lombok/eclipse/EclipseAST.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,9 @@ private EclipseNode buildType(TypeDeclaration type) {
403403
}
404404

405405
private Collection<EclipseNode> buildRecordComponents(AbstractVariableDeclaration[] children) {
406+
if (children == null) return Collections.emptyList();
406407
List<EclipseNode> childNodes = new ArrayList<EclipseNode>();
407-
if (children != null) for (int i = 0; i < children.length; i++) {
408+
for (int i = 0; i < children.length; i++) {
408409
addIfNotNull(childNodes, buildRecordComponent(children[i]));
409410
}
410411
return childNodes;

0 commit comments

Comments
 (0)