From 0075442e80ae4adafc98ac48d848f90c55b83409 Mon Sep 17 00:00:00 2001 From: Arian Mustafa Date: Thu, 28 Mar 2024 20:57:45 +0100 Subject: [PATCH] Fixed copy constructor not setting the proper capacity --- include/digestible/digestible.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/digestible/digestible.h b/include/digestible/digestible.h index 5c73749..7c7ffce 100644 --- a/include/digestible/digestible.h +++ b/include/digestible/digestible.h @@ -276,7 +276,11 @@ tdigest::tdigest(const tdigest& other) , min_val(other.min_val) , max_val(other.max_val) , run_forward(other.run_forward) -{} +{ + one.values.reserve(other.one.capacity()); + two.values.reserve(other.two.capacity()); + buffer.values.reserve(other.buffer.capacity() * buffer_multiplier); +} template void tdigest::swap(tdigest& other)