AK: Add JsonArray::ensure_capacity()

This is helpful for anyone who knows up-front how many items are gonna
be appended to the JsonArray.
This commit is contained in:
Andreas Kling 2019-10-23 14:55:21 +02:00
parent 5a2dd451b5
commit 93dff5df34
Notes: sideshowbarker 2024-07-19 11:34:17 +09:00

View file

@ -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;
};