mirror of
https://github.com/aphrody-labs/oxc.git
synced 2026-10-14 22:29:17 +00:00
perf(packages/codegen): remove redundant setting of last in printImportAttributes and printIf (#25882)
Follow-on after #25585. Small optimization. No point setting `last` here, since in both cases its immediately overwritten before anything else can read it.
This commit is contained in:
1 parent
c6e44c6e80
commit
a734af5347
2 files changed
+2
-2
No files matched your search
@@ -142,7 +142,7 @@ function printImportAttributes(
|
||||
|
||||
// ESTree omits the `WithClause` wrapper. The Rust reference normalizes its mapping anchor
|
||||
// to the first attribute, which is the first location both representations carry.
|
||||
write(state, " ", CAT_OTHER);
|
||||
writeNoLast(state, " ");
|
||||
markWithMapAtStartOffset(state, attributes[0], 0);
|
||||
write(state, "with { ", CAT_OTHER);
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ function printIf(node: ESTree.IfStatement, state: State): void {
|
||||
printBlockStatement(consequent, state);
|
||||
write(state, alternate != null ? " " : "\n", CAT_OTHER);
|
||||
} else if (wrapToAvoidAmbiguousElse(consequent)) {
|
||||
write(state, ") ", CAT_OTHER);
|
||||
writeNoLast(state, ") ");
|
||||
writeWithMap(state, "{\n", CAT_OTHER, consequent);
|
||||
state.indentLevel++;
|
||||
printStatement(consequent, state);
|
||||
|
||||
Reference in new issue
Block a user