Fix clang-tidy performance warnings in update_engine.
* Use const reference type for parameters, local variables,
and for-loop index variables to avoid unnecessary copy.
* Convert some for-loops to for-rang loops.
Bug: 30407689
Bug: 30413223
Bug: 30413862
Change-Id: I78996b3f799639fc57ced45e110807625be7dcce
Test: build with WITH_TIDY=1
diff --git a/common/fake_boot_control.h b/common/fake_boot_control.h
index 5c6c160..3eccc80 100644
--- a/common/fake_boot_control.h
+++ b/common/fake_boot_control.h
@@ -85,9 +85,9 @@
current_slot_ = slot;
}
- void SetPartitionDevice(const std::string partition_name,
+ void SetPartitionDevice(const std::string& partition_name,
BootControlInterface::Slot slot,
- const std::string device) {
+ const std::string& device) {
DCHECK(slot < num_slots_);
devices_[slot][partition_name] = device;
}