mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:34:57 +00:00
AK+Everywhere: Remove JsonValue APIs with implicit default values
This commit is contained in:
parent
c49819cced
commit
b5f1a48a7c
16 changed files with 132 additions and 106 deletions
|
@ -138,16 +138,16 @@ Optional<JsonArray const&> JsonObject::get_array(StringView key) const
|
|||
Optional<double> JsonObject::get_double_with_precision_loss(StringView key) const
|
||||
{
|
||||
auto maybe_value = get(key);
|
||||
if (maybe_value.has_value() && maybe_value->is_number())
|
||||
return maybe_value->to_number<double>();
|
||||
if (maybe_value.has_value())
|
||||
return maybe_value->get_double_with_precision_loss();
|
||||
return {};
|
||||
}
|
||||
|
||||
Optional<float> JsonObject::get_float_with_precision_loss(StringView key) const
|
||||
{
|
||||
auto maybe_value = get(key);
|
||||
if (maybe_value.has_value() && maybe_value->is_number())
|
||||
return maybe_value->to_number<float>();
|
||||
if (maybe_value.has_value())
|
||||
return maybe_value->get_float_with_precision_loss();
|
||||
return {};
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue