From b799683d6058ef02231f563544ff7fcc9864aef8 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 12 Jun 2024 22:17:35 +0700 Subject: [PATCH] fix: pass reference instead copy of argument in util/edge --- src/util/edge.cpp | 4 ++-- src/util/edge.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/edge.cpp b/src/util/edge.cpp index bb7f867127..924c0cb30f 100644 --- a/src/util/edge.cpp +++ b/src/util/edge.cpp @@ -62,7 +62,7 @@ EdgeTriggeredEvents::~EdgeTriggeredEvents() } } -bool EdgeTriggeredEvents::RegisterEntity(int entity, std::string entity_name) const +bool EdgeTriggeredEvents::RegisterEntity(int entity, const std::string& entity_name) const { assert(m_valid); @@ -97,7 +97,7 @@ bool EdgeTriggeredEvents::RegisterEntity(int entity, std::string entity_name) co return true; } -bool EdgeTriggeredEvents::UnregisterEntity(int entity, std::string entity_name) const +bool EdgeTriggeredEvents::UnregisterEntity(int entity, const std::string& entity_name) const { assert(m_valid); diff --git a/src/util/edge.h b/src/util/edge.h index b605cf817c..d1de2f7ba6 100644 --- a/src/util/edge.h +++ b/src/util/edge.h @@ -44,8 +44,8 @@ private: bool UnregisterPipe(int wakeup_pipe); private: - bool RegisterEntity(int entity, std::string entity_name) const; - bool UnregisterEntity(int entity, std::string entity_name) const; + bool RegisterEntity(int entity, const std::string& entity_name) const; + bool UnregisterEntity(int entity, const std::string& entity_name) const; private: /* Flag set if pipe has been registered with instance */