Fix performance-for-range-copy warnings
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: Ib0ea650eca4b183aeaf82c9e6a44d16c80ceeef6
diff --git a/libs/gui/bufferqueue/1.0/H2BGraphicBufferProducer.cpp b/libs/gui/bufferqueue/1.0/H2BGraphicBufferProducer.cpp
index 3b89291..b1e44bb 100644
--- a/libs/gui/bufferqueue/1.0/H2BGraphicBufferProducer.cpp
+++ b/libs/gui/bufferqueue/1.0/H2BGraphicBufferProducer.cpp
@@ -896,7 +896,7 @@
int const* constFds = static_cast<int const*>(baseFds.get());
numFds = baseNumFds;
if (l->unflatten(constBuffer, size, constFds, numFds) != NO_ERROR) {
- for (auto nhA : nhAA) {
+ for (const auto& nhA : nhAA) {
for (auto nh : nhA) {
if (nh != nullptr) {
native_handle_close(nh);
@@ -907,8 +907,8 @@
return false;
}
- for (auto nhA : nhAA) {
- for (auto nh : nhA) {
+ for (const auto& nhA : nhAA) {
+ for (const auto& nh : nhA) {
if (nh != nullptr) {
native_handle_delete(nh);
}