perf(packages/codegen): remove redundant mapping from printParams (#25880)

Follow-on after #25585. Small optimization.

It's redundant to call `markWithMapNoName` with `decorators[0]` as `printDecorators` marks the same mapping immediately after.
This commit is contained in:
overlookmotel committed 2026-08-18 16:34:35 +00:00
1 parent eff863b1c8
commit 880166249c
1 file changed
+5 -2
+5 -2
View File
@@ -110,8 +110,11 @@ function printParams(params: ESTree.ParamPattern[], state: State): void {
}
const { decorators } = param;
markWithMapNoName(state, decorators != null && decorators.length > 0 ? decorators[0] : param);
if (decorators != null && decorators.length > 0) printDecorators(decorators, state);
if (decorators != null && decorators.length > 0) {
printDecorators(decorators, state);
} else {
markWithMapNoName(state, param);
}
if (TS && param.type === "TSParameterProperty") {
if (param.accessibility != null) {