mirror of
https://github.com/aphrody-labs/oxc.git
synced 2026-10-15 06:39:17 +00:00
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:
1 parent
28c6aa63db
commit
c6e44c6e80
1 file changed
+1
-2
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user