mirror of
https://github.com/aphrody-labs/oxc.git
synced 2026-10-15 06:39:17 +00:00
perf(packages/codegen): remove redundant branch (#25885)
Follow-on after #25585. Small optimization. The function exits early if `sourceText === undefined`, so no need to check this again later.
This commit is contained in:
1 parent
be6adf0d51
commit
b6b14c0629
1 file changed
+2
-3
@@ -264,14 +264,13 @@ export function generateSourceMap(state: State, options: Options): SourceMap {
|
||||
previousOriginalColumn = originalColumn;
|
||||
}
|
||||
|
||||
const map: SourceMap = {
|
||||
return {
|
||||
version: 3,
|
||||
mappings: mappingBuffer.toString("ascii", 0, mappingLength),
|
||||
names,
|
||||
sources: [options.sourceFilename ?? ""],
|
||||
sourcesContent: [sourceText],
|
||||
};
|
||||
if (sourceText !== undefined) map.sourcesContent = [sourceText];
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user