From 11f919c4f8ea0cf9ba2fe4c0fc20ae23baf0c1a6 Mon Sep 17 00:00:00 2001 From: Kishore Nallan Date: Tue, 30 Nov 2021 19:35:41 +0530 Subject: [PATCH] Use set for batch indexer request restore. --- src/batched_indexer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/batched_indexer.cpp b/src/batched_indexer.cpp index 04e5d1e1..4d25f976 100644 --- a/src/batched_indexer.cpp +++ b/src/batched_indexer.cpp @@ -354,7 +354,7 @@ void BatchedIndexer::load_state(const nlohmann::json& state) { queued_writes = state["queued_writes"].get(); size_t num_reqs_restored = 0; - std::vector queue_ids; + std::set queue_ids; for(auto& kv: state["req_res_map"].items()) { std::shared_ptr req = std::make_shared(); @@ -382,7 +382,7 @@ void BatchedIndexer::load_state(const nlohmann::json& state) { const std::string& coll_name = get_collection_name(req); uint64_t queue_id = StringUtils::hash_wy(coll_name.c_str(), coll_name.size()) % num_threads; - queue_ids.push_back(queue_id); + queue_ids.insert(queue_id); std::unique_lock qlk(qmutuxes[queue_id].mcv); queues[queue_id].emplace_back(req->start_ts); }