perf(packages/codegen): combine 2 writes in printJSXElement (#25881)

Follow-on after #25585. Small optimization.

These 2 write calls can be combined into 1 without any behavior difference.
This commit is contained in:
overlookmotel committed 2026-08-18 16:54:39 +00:00
1 parent 28c6aa63db
commit c6e44c6e80
1 file changed
+1 -2
+1 -2
View File
@@ -38,8 +38,7 @@ export function printJSXElement(node: ESTree.JSXElement, state: State): void {
writeNoLast(state, " ");
const attribute = attributes[i];
if (attribute.type === "JSXSpreadAttribute") {
writeWithMapNoLast(state, "{", attribute);
write(state, "...", CAT_OTHER);
writeWithMap(state, "{...", CAT_OTHER, attribute);
printExpression(attribute.argument, state, PREC_COMMA, CTX_NONE);
writeWithMapEnd(state, "}", CAT_OTHER, attribute);
} else {