Make List constructor with capacity reserve the space, instead of creating the vector with a set size.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-04-24 18:48:23 +02:00
parent 409b52bbf7
commit 846a9380a7
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 1 additions and 1 deletions

View File

@ -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<ValueT>& l) : _vector(l) {}
List(const ValueT* begin, const ValueT* end) : _vector(begin, end) {}