clang-tidy: Enable performance-unnecessary-value-param check
This check flags value parameter declarations of expensive to copy
types that are copied for each invocation but it would suffice to
pass them by const reference.
Change-Id: I631deda63fcbb74362313c9596bf7e72933b0d0c
Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index f624cbe..1f62133 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -523,8 +523,8 @@
std::pair<std::string, uint8_t>)>
cmpPriority;
cmpPriority cmpPriorityFunc =
- [](std::pair<std::string, uint8_t> priority1,
- std::pair<std::string, uint8_t> priority2) {
+ [](const std::pair<std::string, uint8_t>& priority1,
+ const std::pair<std::string, uint8_t>& priority2) {
return priority1.second <= priority2.second;
};
@@ -563,7 +563,7 @@
info("BMC factory reset will take effect upon reboot.");
}
-void ItemUpdater::removeReadOnlyPartition(std::string versionId)
+void ItemUpdater::removeReadOnlyPartition(const std::string& versionId)
{
auto flashId = versions.find(versionId)->second->path();
helper.removeVersion(flashId);
@@ -867,7 +867,7 @@
biosActivation = std::make_unique<Activation>(
bus, path, *this, versionId, server::Activation::Activations::Active,
assocs);
- auto dummyErase = [](std::string /*entryId*/) {
+ auto dummyErase = [](const std::string& /*entryId*/) {
// Do nothing;
};
biosVersion = std::make_unique<VersionClass>(