tidy: fix performance-inefficient-string-concatenation
Tested by building and running the unit tests.
Change-Id: Ia7638172abcd737d6036bb5b2b96d03fb0a85562
Signed-off-by: Brad Bishop <bradbish@qti.qualcomm.com>
diff --git a/src/handler.cpp b/src/handler.cpp
index 5575f2d..89c9913 100644
--- a/src/handler.cpp
+++ b/src/handler.cpp
@@ -1,5 +1,6 @@
#include "handler.hpp"
+#include "path.hpp"
#include "types.hpp"
#include <xyz/openbmc_project/Common/error.hpp>
@@ -427,7 +428,8 @@
for (const auto& subtreePath : subtreePaths)
{
// Form the association path
- std::string associationPathStr = subtreePath + "/" + association;
+ std::string associationPathStr =
+ appendPathSegment(subtreePath, association);
sdbusplus::message::object_path associationPath(associationPathStr);
auto associatedSubTree =
@@ -453,7 +455,8 @@
for (const auto& subtreePath : subtreePaths)
{
// Form the association path
- std::string associationPathStr = subtreePath + "/" + association;
+ std::string associationPathStr =
+ appendPathSegment(subtreePath, association);
sdbusplus::message::object_path associationPath(associationPathStr);
auto associatedSubTree = getAssociatedSubTreePaths(