Ver código fonte

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.
Dan Klishch 1 ano atrás
pai
commit
77f36a9e46
1 arquivos alterados com 0 adições e 2 exclusões
  1. 0 2
      Userland/Libraries/LibJS/Runtime/JSONObject.cpp

+ 0 - 2
Userland/Libraries/LibJS/Runtime/JSONObject.cpp

@@ -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())