perf(codegen): reduce writes in printDecorators (#27651)

Small perf optimization. Combine 2 writes into 1 for decorators which have to be wrapped.
This commit is contained in:
overlookmotel committed 2026-10-13 12:30:38 +00:00
1 parent 027f677d32
commit e533278327
1 file changed
+1 -3
+1 -3
View File
@@ -135,9 +135,7 @@ export function printDecorators(decorators: ESTree.Decorator[], state: State): v
const wrap = decoratorNeedsWrap(expression);
if (wrap) write(state, "(", CAT_OTHER);
printExpression(expression, state, PREC_LOWEST, CTX_NONE);
if (wrap) write(state, ")", CAT_CLOSE_BRACKET);
write(state, " ", CAT_OTHER);
write(state, wrap ? ") " : " ", CAT_OTHER);
}
}