mirror of
https://github.com/aphrody-labs/oxc.git
synced 2026-10-15 06:39:17 +00:00
perf(packages/codegen): combine condition checks (#25976)
Small optimization to sourcemap builds. - Before: `end < start || start === end` - After: `end <= start` The 2 are equivalent.
This commit is contained in:
1 parent
215a6a51ad
commit
c22a9cc260
1 file changed
+2
-4
@@ -481,8 +481,7 @@ export function markMapAtStartOffset(state: State, node: MappableNode, columnOff
|
||||
|| !Number.isSafeInteger(start)
|
||||
|| !Number.isSafeInteger(end)
|
||||
|| start < 0
|
||||
|| end < start
|
||||
|| start === end
|
||||
|| end <= start
|
||||
) {
|
||||
return;
|
||||
}
|
||||
@@ -516,8 +515,7 @@ function recordSourceMapping(state: State, node: MappableNode, location: Locatio
|
||||
|| !Number.isSafeInteger(start)
|
||||
|| !Number.isSafeInteger(end)
|
||||
|| start < 0
|
||||
|| end < start
|
||||
|| start === end
|
||||
|| end <= start
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user