Use INT32_MAX instead of inline value

This commit is contained in:
Saúl Ibarra Corretgé 2024-08-13 09:53:40 +02:00
parent da1d3cb994
commit 5db156fb08

View file

@ -516,7 +516,7 @@ static js_force_inline JSValue JS_NewInt64(JSContext *ctx, int64_t val)
static js_force_inline JSValue JS_NewUint32(JSContext *ctx, uint32_t val)
{
JSValue v;
if (val <= 0x7fffffff) {
if (val <= INT32_MAX) {
v = JS_NewInt32(ctx, (int32_t)val);
} else {
v = JS_NewFloat64(ctx, (double)val);