mirror of
https://github.com/aphrody-labs/oxc.git
synced 2026-10-14 22:29:17 +00:00
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:
1 parent
eff863b1c8
commit
880166249c
1 file changed
+5
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user