From 03b25facdf35117eb9f56c7a2edbec5b34b90203 Mon Sep 17 00:00:00 2001 From: Max-001 <80035972+Max-001@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:22:38 +0200 Subject: Replace push_back with emplace_back --- mwe/ecs-homemade/inc/ComponentManager.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mwe/ecs-homemade/inc/ComponentManager.hpp b/mwe/ecs-homemade/inc/ComponentManager.hpp index 75b2ab1..53dfddd 100644 --- a/mwe/ecs-homemade/inc/ComponentManager.hpp +++ b/mwe/ecs-homemade/inc/ComponentManager.hpp @@ -76,7 +76,7 @@ std::vector, std::uint32_t>> ComponentManage T* castedComponent = static_cast(componentPtr.get()); //Cast the unique_ptr to a raw pointer if (castedComponent) { //Ensure that the cast was successful - componentVector.push_back(std::make_pair(std::ref(*castedComponent), id)); //Pair the dereferenced raw pointer and the id and add it to the vector<> + componentVector.emplace_back(std::ref(*castedComponent), id); //Pair the dereferenced raw pointer and the id and add it to the vector<> } } -- cgit v1.2.3