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/associations.cpp b/src/associations.cpp
index fc2703f..329f3d4 100644
--- a/src/associations.cpp
+++ b/src/associations.cpp
@@ -1,5 +1,7 @@
#include "associations.hpp"
+#include "path.hpp"
+
#include <boost/asio/steady_timer.hpp>
#include <sdbusplus/exception.hpp>
@@ -268,11 +270,11 @@
if (!forward.empty())
{
- objects[path + "/" + forward].emplace(objectPath);
+ objects[appendPathSegment(path, forward)].emplace(objectPath);
}
if (!reverse.empty())
{
- objects[objectPath + "/" + reverse].emplace(path);
+ objects[appendPathSegment(objectPath, reverse)].emplace(path);
}
}
for (const auto& object : objects)
@@ -644,15 +646,19 @@
reverseType, owner, assocMaps);
// Remove both sides of the association from assocMaps.ifaces
- removeAssociationIfacesEntry(io, forwardPath + '/' + forwardType,
- reversePath, assocMaps, server);
- removeAssociationIfacesEntry(io, reversePath + '/' + reverseType,
- forwardPath, assocMaps, server);
+ removeAssociationIfacesEntry(
+ io, appendPathSegment(forwardPath, forwardType), reversePath,
+ assocMaps, server);
+ removeAssociationIfacesEntry(
+ io, appendPathSegment(reversePath, reverseType), forwardPath,
+ assocMaps, server);
// Remove both sides of the association from assocMaps.owners
- removeAssociationOwnersEntry(forwardPath + '/' + forwardType,
- reversePath, owner, assocMaps);
- removeAssociationOwnersEntry(reversePath + '/' + reverseType,
- forwardPath, owner, assocMaps);
+ removeAssociationOwnersEntry(
+ appendPathSegment(forwardPath, forwardType), reversePath, owner,
+ assocMaps);
+ removeAssociationOwnersEntry(
+ appendPathSegment(reversePath, reverseType), forwardPath, owner,
+ assocMaps);
}
}