TangSiyang2001 commented on code in PR #15339: URL: https://github.com/apache/doris/pull/15339#discussion_r1109628442
########## be/src/vec/aggregate_functions/aggregate_function_collect.h: ########## @@ -49,18 +49,16 @@ struct AggregateFunctionCollectSetData { data_set.insert(assert_cast<const ColVecType&>(column).get_data()[row_num]); } - void merge(const SelfType& rhs) { data_set.merge(rhs.data_set); } - - void merge(const SelfType& rhs, bool has_limit) { - if (!has_limit) { - merge(rhs); - return; - } - for (auto& rhs_elem : rhs.data_set) { - if (size() >= max_size) { - return; + void merge(const SelfType& rhs) { + if constexpr (HasLimit::value) { + data_set.merge(rhs.data_set); + } else { Review Comment: OK, I'll check it out. -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org