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.
This commit is contained in:
2024-07-26 21:43:19 +01:00
parent 7720544e07
commit ca7931e0c2

View File

@@ -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) word_t NodeAllocator::alloc(Node n)