Codechange: Let's use this new emplace_back() thing. (#13081)

This commit is contained in:
Peter Nelson
2024-11-15 20:28:17 +00:00
committed by GitHub
parent 98c8445519
commit 14e2839087
4 changed files with 9 additions and 16 deletions

View File

@@ -77,8 +77,8 @@ public:
/* Build edge list from edge matrix. */
for (NodeID to = edges[_linkgraph_from].dest_node; to != INVALID_NODE; to = edges[to].dest_node) {
bn->edges.push_back(edges[to]);
bn->edges.back().dest_node = to;
auto &edge = bn->edges.emplace_back(edges[to]);
edge.dest_node = to;
}
/* Sort by destination. */
std::sort(bn->edges.begin(), bn->edges.end());