diff options
author | Kemal Zebari <kemalzebra@gmail.com> | 2023-05-03 09:31:23 -0700 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-05-03 21:39:09 +0100 |
commit | 582c55a1c8885369841f4621400108629127db7e (patch) | |
tree | 489f568c4a7ae5cd6ca5aae7e1e90dc6a52c2d71 /AK/JsonArray.h | |
parent | 590723aa3bc7baba70ddcfdac1fe2cc403dbf6e0 (diff) | |
download | serenity-582c55a1c8885369841f4621400108629127db7e.zip |
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.
Diffstat (limited to 'AK/JsonArray.h')
-rw-r--r-- | AK/JsonArray.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/JsonArray.h b/AK/JsonArray.h index e292defa48..1154925568 100644 --- a/AK/JsonArray.h +++ b/AK/JsonArray.h @@ -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; |