diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-23 14:55:21 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-23 14:55:21 +0200 |
commit | 93dff5df34bd03e2d8ab50de20d191b2eebf43f0 (patch) | |
tree | d79cb81bf4d8425d2fd52d5b4551d8cfb331bd39 /AK | |
parent | 5a2dd451b5532f04c3864211dcf618ee714b82ec (diff) | |
download | serenity-93dff5df34bd03e2d8ab50de20d191b2eebf43f0.zip |
AK: Add JsonArray::ensure_capacity()
This is helpful for anyone who knows up-front how many items are gonna
be appended to the JsonArray.
Diffstat (limited to 'AK')
-rw-r--r-- | AK/JsonArray.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/AK/JsonArray.h b/AK/JsonArray.h index 57fd12bb6b..99aad414cf 100644 --- a/AK/JsonArray.h +++ b/AK/JsonArray.h @@ -62,6 +62,8 @@ public: const Vector<JsonValue>& values() const { return m_values; } + void ensure_capacity(int capacity) { m_values.ensure_capacity(capacity); } + private: Vector<JsonValue> m_values; }; |