From 67da6a9325a2967a0b53eb5cd9fb67f46ab9a2b3 Mon Sep 17 00:00:00 2001 From: AlexanderSaydakov Date: Mon, 21 Oct 2024 15:17:48 -0700 Subject: [PATCH] non-modifying merge --- tdigest/include/tdigest.hpp | 2 +- tdigest/include/tdigest_impl.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tdigest/include/tdigest.hpp b/tdigest/include/tdigest.hpp index 38f3b1a5..bb4f7376 100644 --- a/tdigest/include/tdigest.hpp +++ b/tdigest/include/tdigest.hpp @@ -115,7 +115,7 @@ class tdigest { * Merge the given t-Digest into this one * @param other t-Digest to merge */ - void merge(tdigest& other); + void merge(const tdigest& other); /** * Process buffered values and merge centroids if needed diff --git a/tdigest/include/tdigest_impl.hpp b/tdigest/include/tdigest_impl.hpp index afc64ef3..165bda6c 100644 --- a/tdigest/include/tdigest_impl.hpp +++ b/tdigest/include/tdigest_impl.hpp @@ -44,7 +44,7 @@ void tdigest::update(T value) { } template -void tdigest::merge(tdigest& other) { +void tdigest::merge(const tdigest& other) { if (other.is_empty()) return; vector_centroid tmp(buffer_.get_allocator()); tmp.reserve(buffer_.size() + centroids_.size() + other.buffer_.size() + other.centroids_.size());