Fix performance-for-range-copy warnings
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: I1b76a22eab100a31e77048626e48169fe7eeaf92
diff --git a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
index 7492152..629477a 100644
--- a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
+++ b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
@@ -83,7 +83,7 @@
sp<IContexthub> hubApi = ::testing::VtsHalHidlTargetTestBase::getService<IContexthub>();
if (hubApi != nullptr) {
- for (ContextHub hub : getHubsSync(hubApi)) {
+ for (const ContextHub& hub : getHubsSync(hubApi)) {
hubIds.push_back(hub.hubId);
}
}
@@ -206,7 +206,7 @@
hidl_vec<ContextHub> hubs = getHubsSync(hubApi);
ALOGD("System reports %zu hubs", hubs.size());
- for (ContextHub hub : hubs) {
+ for (const ContextHub& hub : hubs) {
ALOGD("Checking hub ID %" PRIu32, hub.hubId);
EXPECT_FALSE(hub.name.empty());