Skip to content

Commit

Permalink
preallocate
Browse files Browse the repository at this point in the history
Signed-off-by: Laurynas Jagutis <[email protected]>
  • Loading branch information
Laurynas-Jagutis committed Oct 2, 2024
1 parent 646863f commit ac4c29f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ inline std::string PgmVnfConverter::convert_input() {
convert_links_input();

power_grid_model::Container<power_grid_model::Node> container;

for (const auto& node : nodes) {
container.emplace<power_grid_model::Node>(node.id(), node);
}
Expand Down Expand Up @@ -121,6 +121,7 @@ inline std::vector<power_grid_model::Node> PgmVnfConverter::convert_node_input()

std::vector<power_grid_model::Node> nodes;

nodes.reserve(node_inputs.size());
for (const auto& node_input : node_inputs) {
nodes.emplace_back(node_input);
}
Expand Down

0 comments on commit ac4c29f

Please sign in to comment.