Change to pass by reference
removeActiveAssociation and createActiveAssociation should be
pass by reference.
Change-Id: If9396b4ab36fc4497db0cf0b6da7e04a2c6c4055
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index dda7a8d..34096df 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -465,7 +465,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,
@@ -481,7 +481,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 09d0638..4b7ddd5 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -90,13 +90,13 @@
*
* @param[in] path - The path to create the association to.
*/
- void createActiveAssociation(std::string path);
+ void createActiveAssociation(const std::string& path);
/** @brief Removes an active association to the software image
*
* @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.