mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
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:
1 parent
027f677d32
commit
e533278327
1 file changed
+1
-3
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user