LibJS: Remove redundant use of JsonValue::{is,as}_i32()

Value::Value(double) already converts double to int when it is safe, no
need to check for this here explicitly. While this technically removes
an optimization, I doubt that it will regress performance in any
measurable way.
This commit is contained in:
Dan Klishch 2023-11-13 21:55:18 -05:00 committed by Andrew Kaster
parent b74df136fe
commit 77f36a9e46
Notes: sideshowbarker 2024-07-17 06:29:49 +09:00

View File

@ -434,8 +434,6 @@ Value JSONObject::parse_json_value(VM& vm, JsonValue const& value)
return Value(parse_json_array(vm, value.as_array()));
if (value.is_null())
return js_null();
if (value.is_i32())
return Value(value.as_i32());
if (value.is_number())
return Value(value.to_double(0));
if (value.is_string())