summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorKemal Zebari <kemalzebra@gmail.com>2023-05-03 09:31:23 -0700
committerSam Atkins <atkinssj@gmail.com>2023-05-03 21:39:09 +0100
commit582c55a1c8885369841f4621400108629127db7e (patch)
tree489f568c4a7ae5cd6ca5aae7e1e90dc6a52c2d71 /AK
parent590723aa3bc7baba70ddcfdac1fe2cc403dbf6e0 (diff)
downloadserenity-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')
-rw-r--r--AK/JsonArray.h2
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;