Commit ecc9c60
committed
perf(napi/parser): raw transfer: reduce maths complexity (#13145)
Tiny perf optimization.
Reduce complexity of maths by doing as much calculation as possible using consts.
Shaves off 1 operation! https://godbolt.org/z/5h4hzznxs
This change does not alter the result. `data_offset + RAW_METADATA_SIZE` couldn't overflow because `data_offset` was derived from a `u32`, and this code (raw transfer) is only run on 64-bit systems, so there's plenty of headroom in `usize`. But it does make it easier to support 32-bit in future.1 parent c63c944 commit ecc9c60
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
0 commit comments