1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:57:46 +00:00

AK+GMLCompiler+LibWeb: Remove JsonValue::is_double

This concludes a series of patches which remove the ability to observe
which arithmetic type is used to store number in JsonValue.
This commit is contained in:
Dan Klishch 2023-11-14 01:15:54 -05:00 committed by Andrew Kaster
parent faef802229
commit c49819cced
5 changed files with 6 additions and 21 deletions

View file

@ -182,11 +182,6 @@ public:
bool is_null() const { return m_type == Type::Null; }
bool is_bool() const { return m_type == Type::Bool; }
bool is_string() const { return m_type == Type::String; }
bool is_i32() const { return m_type == Type::Int32; }
bool is_u32() const { return m_type == Type::UnsignedInt32; }
bool is_i64() const { return m_type == Type::Int64; }
bool is_u64() const { return m_type == Type::UnsignedInt64; }
bool is_double() const { return m_type == Type::Double; }
bool is_array() const { return m_type == Type::Array; }
bool is_object() const { return m_type == Type::Object; }
bool is_number() const
@ -206,7 +201,7 @@ public:
template<typename T>
T to_number(T default_value = 0) const
{
if (is_double())
if (type() == Type::Double)
return (T)m_value.as_double;
if (type() == Type::Int32)
return (T)m_value.as_i32;