From ac4c29fc846cb3c38fa511abf3abe597c6a1b994 Mon Sep 17 00:00:00 2001 From: Laurynas Jagutis Date: Wed, 2 Oct 2024 14:43:30 +0200 Subject: [PATCH] preallocate Signed-off-by: Laurynas Jagutis --- .../vnf_converter/vnf_pgm_converter.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp b/power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp index be2d082..b4193d5 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp +++ b/power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp @@ -87,7 +87,7 @@ inline std::string PgmVnfConverter::convert_input() { convert_links_input(); power_grid_model::Container container; - + for (const auto& node : nodes) { container.emplace(node.id(), node); } @@ -121,6 +121,7 @@ inline std::vector PgmVnfConverter::convert_node_input() std::vector nodes; + nodes.reserve(node_inputs.size()); for (const auto& node_input : node_inputs) { nodes.emplace_back(node_input); }