mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 12:56:23 +03:00
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:
parent
b74df136fe
commit
77f36a9e46
Notes:
sideshowbarker
2024-07-17 06:29:49 +09:00
Author: https://github.com/DanShaders Commit: https://github.com/SerenityOS/serenity/commit/77f36a9e46 Pull-request: https://github.com/SerenityOS/serenity/pull/22729 Reviewed-by: https://github.com/ADKaster ✅
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user