mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:37:34 +00:00
AK: Have JsonArray::set()
change values instead of inserting values
Resolves #18618.
8134dcc
changed `JsonArray::set()` to insert elements at an index
instead of changing existing elements in-place. Since no behavior
such as `Vector::try_at()` exists yet, it returns nothing.
This commit is contained in:
parent
590723aa3b
commit
582c55a1c8
2 changed files with 2 additions and 2 deletions
|
@ -66,7 +66,7 @@ public:
|
|||
|
||||
void clear() { m_values.clear(); }
|
||||
ErrorOr<void> append(JsonValue value) { return m_values.try_append(move(value)); }
|
||||
ErrorOr<void> set(size_t index, JsonValue value) { return m_values.try_insert(index, move(value)); }
|
||||
void set(size_t index, JsonValue value) { m_values.at(index) = move(value); }
|
||||
|
||||
template<typename Builder>
|
||||
typename Builder::OutputType serialized() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue