sryanyuan commented on code in PR #3386:
URL: https://github.com/apache/kvrocks/pull/3386#discussion_r2915567219
##########
src/cluster/cluster.cc:
##########
@@ -843,7 +855,9 @@ Status Cluster::parseClusterNodes(const std::string
&nodes_str, ClusterNodes *no
}
// Create master node
- (*nodes)[id] = std::make_shared<ClusterNode>(id, host, port, role,
master_id, slots);
+ auto master_node = std::make_shared<ClusterNode>(id, host, port, role,
master_id, slots);
+ master_node->failed = node_failed;
+ (*nodes)[id] = master_node;
Review Comment:
Might emplace be more efficient here? nodes->emplace(id, std::move(node));
avoids the extra default construction step.
--
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]