From 93dff5df34bd03e2d8ab50de20d191b2eebf43f0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 23 Oct 2019 14:55:21 +0200 Subject: [PATCH] AK: Add JsonArray::ensure_capacity() This is helpful for anyone who knows up-front how many items are gonna be appended to the JsonArray. --- AK/JsonArray.h | 2 ++ 1 file changed, 2 insertions(+) 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& values() const { return m_values; } + void ensure_capacity(int capacity) { m_values.ensure_capacity(capacity); } + private: Vector m_values; };