automotive: Remove unnecessary std::move
Moving a temporary object prevents copy elision, and could reduce
performance.
This fixes -Wpessimizing-move compiler warning.
Test: presubmit
Bug: 154270751
Change-Id: Ia2ffdb8addde27a67d2e2382bef1d45d5261f3ca
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index 80b069a..c3650c5 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -95,7 +95,7 @@
std::lock_guard<std::mutex> lockGuard(mLock);
for (auto& value : values) {
int32_t propId = value->getPropId();
- mEvents[propId].push_back(std::move(value->clone()));
+ mEvents[propId].push_back(value->clone());
}
}
mEventCond.notify_one();
@@ -122,7 +122,7 @@
return events;
}
for (const auto& eventPtr : mEvents[propId]) {
- events.push_back(std::move(eventPtr->clone()));
+ events.push_back(eventPtr->clone());
}
return events;
}