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)