Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
jv_number_value
should cache the double value of literal numbers
The code of `jv_number_value` is intended to cache the double value of literal numbers, but it does not work because the function accepts the `jv` struct by value. This patch fixes the behavior by checking if the double value is `NaN`, which is the initial value. This patch apparently does not cache the value if the literal is `NaN`, but improves the performance of major use cases; e.g. `range(1000000)` runs 25% faster.
- Loading branch information