From ca7931e0c29785314d2fe88279dabd55c9afc7c2 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 26 Jul 2024 21:43:19 +0100 Subject: NodeAllocator constructor now reserves space in vector This is different to vec{capacity}, which would adjust vec::size. This adjusts vec::capacity instead, which is what I want. --- src/numerics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/numerics.cpp b/src/numerics.cpp index 66ddc02..33ee5ab 100644 --- a/src/numerics.cpp +++ b/src/numerics.cpp @@ -48,8 +48,9 @@ Node::Node(Fraction val, index_t left, index_t right) { } -NodeAllocator::NodeAllocator(word_t capacity) : vec{capacity} +NodeAllocator::NodeAllocator(word_t capacity) { + vec.reserve(capacity); } word_t NodeAllocator::alloc(Node n) -- cgit v1.2.3-13-gbd6f