From 846a9380a755902120691829362855f9ac5c9e33 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 24 Apr 2020 18:48:23 +0200 Subject: [PATCH] Make List constructor with capacity reserve the space, instead of creating the vector with a set size. --- src/Collections/List.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Collections/List.hpp b/src/Collections/List.hpp index d3555c4..79a11fe 100644 --- a/src/Collections/List.hpp +++ b/src/Collections/List.hpp @@ -16,7 +16,7 @@ namespace Arbutils::Collections { public: List() : _vector() {} - explicit List(size_t capacity) : _vector(capacity) {} + explicit List(size_t capacity) : _vector(0) { _vector.reserve(capacity); } List(const std::initializer_list& l) : _vector(l) {} List(const ValueT* begin, const ValueT* end) : _vector(begin, end) {}