Change to pass by reference
removeActiveAssociation and createActiveAssociation should be
pass by reference.
Change-Id: I5d4bb8a15714dcae5f2b71c5151262940cc91f49
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index b451932..1014890 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -521,7 +521,7 @@
}
}
-void ItemUpdater::createActiveAssociation(std::string path)
+void ItemUpdater::createActiveAssociation(const std::string& path)
{
assocs.emplace_back(std::make_tuple(ACTIVE_FWD_ASSOCIATION,
ACTIVE_REV_ASSOCIATION,
@@ -549,7 +549,7 @@
associations(assocs);
}
-void ItemUpdater::removeActiveAssociation(std::string path)
+void ItemUpdater::removeActiveAssociation(const std::string& path)
{
for (auto iter = assocs.begin(); iter != assocs.end();)
{
diff --git a/item_updater.hpp b/item_updater.hpp
index 1c65a1c..3c8698f 100755
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -104,7 +104,7 @@
*
* @param[in] path - The path to create the association to.
*/
- void createActiveAssociation(std::string path);
+ void createActiveAssociation(const std::string& path);
/** @brief Updates the functional association to the
* new "running" PNOR image
@@ -117,7 +117,7 @@
*
* @param[in] path - The path to remove the association from.
*/
- void removeActiveAssociation(std::string path);
+ void removeActiveAssociation(const std::string& path);
private:
/** @brief Callback function for Software.Version match.