commit | 48fc6191823ffa0708f60802fb6724c232760b9a | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Fri Aug 04 14:37:31 2017 -0700 |
committer | Chih-Hung Hsieh <chh@google.com> | Fri Aug 04 14:58:41 2017 -0700 |
tree | c4b5ac89c6bb9798f20fa29b392306027003c4a2 | |
parent | b95106cabbe51d440505e5b97c55a3afebd49af9 [diff] [blame] |
Fix performance-for-range-copy warnings in frameworks/av. * Use const reference type for loop index variables to avoid unnecessary copy. Bug: 30413223 Test: build with WITH_TIDY=1 Change-Id: I79969be18569c5bb1ea29ee18ae89a3f9d55ce9c
diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp index b02cd6a..865b44d 100644 --- a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp +++ b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
@@ -729,7 +729,7 @@ const std::vector<sp<GraphicBuffer>>& removedBuffers) { sp<Camera3StreamBufferFreedListener> callback = mBufferFreedListener.promote(); if (callback != nullptr) { - for (auto gb : removedBuffers) { + for (const auto& gb : removedBuffers) { callback->onBufferFreed(mId, gb->handle); } }