mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:17:35 +00:00
AK+Spreadsheet+LibWeb: Remove JsonObject::get_or()
This removes JsonObject::get_or(), which is inefficient because it has to copy the returned value. It was only used in a few cases, some of which resulted in copying JsonObjects, which can become quite large.
This commit is contained in:
parent
e82611bb87
commit
9c8a2a5f69
4 changed files with 91 additions and 97 deletions
|
@ -59,12 +59,6 @@ public:
|
|||
return *value;
|
||||
}
|
||||
|
||||
JsonValue get_or(String const& key, JsonValue const& alternative) const
|
||||
{
|
||||
auto* value = get_ptr(key);
|
||||
return value ? *value : alternative;
|
||||
}
|
||||
|
||||
JsonValue const* get_ptr(String const& key) const
|
||||
{
|
||||
auto it = m_members.find(key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue