Codechange: Use map.emplace() instead of map.insert(std::pair).

This avoids a copy of the pair into the map.
This commit is contained in:
Peter Nelson
2024-04-20 02:46:39 +01:00
committed by Peter Nelson
parent 57d7359b1a
commit ed2db80990
7 changed files with 9 additions and 13 deletions

View File

@@ -318,7 +318,7 @@ public:
for (uint32_t j = 0; j < num_flows; ++j) {
SlObject(&flow, this->GetLoadDescription());
if (fs == nullptr || prev_source != flow.source) {
fs = &(ge->flows.insert(std::make_pair(flow.source, FlowStat(flow.via, flow.share, flow.restricted))).first->second);
fs = &(ge->flows.emplace(flow.source, FlowStat(flow.via, flow.share, flow.restricted))).first->second;
} else {
fs->AppendShare(flow.via, flow.share, flow.restricted);
}