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:
overlookmotel committed 2026-08-24 07:31:35 +00:00
1 parent 215a6a51ad
commit c22a9cc260
1 file changed
+2 -4
+2 -4
View File
@@ -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;
}