stojkomilos commented on code in PR #573:
URL: https://github.com/apache/datasketches-cpp/pull/573#discussion_r4547803497
##########
kll/include/kll_sketch_impl.hpp:
##########
@@ -181,8 +181,15 @@ template<typename FwdT>
void kll_sketch<T, C, A>::update(FwdT&& item) {
if (!check_update_item(item)) { return; }
update_min_max(static_cast<const T&>(item)); // min and max are always copies
- const uint32_t index = internal_update();
- new (&items_[index]) T(std::forward<FwdT>(item));
+ if (levels_[0] == 0) {
Review Comment:
Compaction and regrowth can only happen when level 0 is full. So we use that
fact to handle this situation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]