Skip to content

Commit dcdc353

Browse files
committed
fix zset_union_store
1 parent 34072fb commit dcdc353

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/cppredis/cpp_zset_client.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,14 @@ namespace cpp_redis {
341341

342342
virtual int zset_union_store(std::vector<std::string>&& keys, aggregate_mothod mothod)
343343
{
344-
if (mothod != aggregate_mothod::agg_none){
344+
if (mothod >aggregate_mothod::agg_none &&
345+
mothod <=aggregate_mothod::agg_max) {
345346
keys.emplace_back("AGGREGATE");
346347
keys.emplace_back(request_->get_aggregate_mothod(mothod));
347348
}
348349

349-
std::string msg = request_->req_n_keys(request_->get_cmd(redis_cmd::zset_union_store), std::forward<std::vector<std::string>>(keys));
350+
std::string msg = request_->req_n_keys(request_->get_cmd(redis_cmd::zset_union_store),
351+
std::forward<std::vector<std::string>>(keys));
350352
socket_->send_msg(std::move(msg));
351353

352354
const auto res = socket_->get_responese();

0 commit comments

Comments
 (0)