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:
committed by
Peter Nelson
parent
57d7359b1a
commit
ed2db80990
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user