You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2021/03/22 21:01:38 UTC
[datasketches-cpp] branch master updated: Late initialization of
iterator in kll sketch
This is an automated email from the ASF dual-hosted git repository.
alsay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git
The following commit(s) were added to refs/heads/master by this push:
new 9e47f3e Late initialization of iterator in kll sketch
new 24db41a Merge pull request #207 from comtestwireless/master
9e47f3e is described below
commit 9e47f3eed1156aba519b06d8245a68feb2a37222
Author: marco.manino <ma...@comtestwireless.eu>
AuthorDate: Mon Mar 22 09:48:18 2021 +0100
Late initialization of iterator in kll sketch
---
kll/include/kll_quantile_calculator_impl.hpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kll/include/kll_quantile_calculator_impl.hpp b/kll/include/kll_quantile_calculator_impl.hpp
index 23efa4d..ff6e547 100644
--- a/kll/include/kll_quantile_calculator_impl.hpp
+++ b/kll/include/kll_quantile_calculator_impl.hpp
@@ -129,10 +129,11 @@ void kll_quantile_calculator<T, C, A>::merge_sorted_blocks_direct(Container& ori
const uint8_t num_levels_2 = num_levels - num_levels_1;
const uint8_t starting_level_1 = starting_level;
const uint8_t starting_level_2 = starting_level + num_levels_1;
- const auto chunk_begin = temp.begin() + temp.size();
+ const auto initial_size = temp.size();
merge_sorted_blocks_reversed(orig, temp, levels, starting_level_1, num_levels_1);
merge_sorted_blocks_reversed(orig, temp, levels, starting_level_2, num_levels_2);
const uint32_t num_items_1 = levels[starting_level_1 + num_levels_1] - levels[starting_level_1];
+ const auto chunk_begin = temp.begin() + initial_size;
std::merge(
std::make_move_iterator(chunk_begin), std::make_move_iterator(chunk_begin + num_items_1),
std::make_move_iterator(chunk_begin + num_items_1), std::make_move_iterator(temp.end()),
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org