From 3617f5c22621be4780bb30021b920fd72189b72b Mon Sep 17 00:00:00 2001 From: max-001 Date: Wed, 6 Nov 2024 14:45:01 +0100 Subject: Made std::string const reference (instead of copy by value) --- src/crepe/api/GameObject.cpp | 5 +++-- src/crepe/api/GameObject.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/crepe/api/GameObject.cpp b/src/crepe/api/GameObject.cpp index ffc9510..b24b980 100644 --- a/src/crepe/api/GameObject.cpp +++ b/src/crepe/api/GameObject.cpp @@ -6,8 +6,9 @@ using namespace crepe; using namespace std; -GameObject::GameObject(uint32_t id, std::string name, std::string tag, - const Point & position, double rotation, double scale) +GameObject::GameObject(uint32_t id, const std::string & name, + const std::string & tag, const Point & position, + double rotation, double scale) : id(id) { // Add Transform and Metadata components ComponentManager & mgr = ComponentManager::get_instance(); diff --git a/src/crepe/api/GameObject.h b/src/crepe/api/GameObject.h index 13aa681..2a82258 100644 --- a/src/crepe/api/GameObject.h +++ b/src/crepe/api/GameObject.h @@ -27,7 +27,7 @@ public: * \param rotation The rotation of the GameObject * \param scale The scale of the GameObject */ - GameObject(uint32_t id, std::string name, std::string tag, + GameObject(uint32_t id, const std::string & name, const std::string & tag, const Point & position, double rotation, double scale); /** * \brief Set the parent of this GameObject -- cgit v1.2.3