summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2016-07-27 23:21:41 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-07-27 23:21:42 +0000
commit1f6947bcd9f72696db68970c792f3eaea94f5479 (patch)
treeccf14438cb12c7716c52496195944fda0589ce99
parentb40840ff742c8e41f76bae895e01cf4f798b1a79 (diff)
parenta3b37f4d08e757ce90a7b02ca0e15951455c477c (diff)
downloadextras-1f6947bcd9f72696db68970c792f3eaea94f5479.tar.gz
Merge "Fix clang-tidy performance warnings in libfec."
-rw-r--r--libfec/fec_verity.cpp2
-rw-r--r--verity/fec/image.cpp2
-rw-r--r--verity/fec/main.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/libfec/fec_verity.cpp b/libfec/fec_verity.cpp
index 393e9624..5dea53dd 100644
--- a/libfec/fec_verity.cpp
+++ b/libfec/fec_verity.cpp
@@ -349,7 +349,7 @@ static int parse_table(fec_handle *f, uint64_t offset, uint32_t size)
auto tokens = android::base::Split(table.get(), " ");
- for (const auto token : tokens) {
+ for (const auto& token : tokens) {
switch (i++) {
case 0: /* version */
if (token != stringify(VERITY_TABLE_VERSION)) {
diff --git a/verity/fec/image.cpp b/verity/fec/image.cpp
index a378c932..610a4627 100644
--- a/verity/fec/image.cpp
+++ b/verity/fec/image.cpp
@@ -290,7 +290,7 @@ bool image_load(const std::vector<std::string>& filenames, image *ctx,
std::vector<int> fds;
- for (auto fn : filenames) {
+ for (const auto& fn : filenames) {
int fd = TEMP_FAILURE_RETRY(open(fn.c_str(), flags | O_LARGEFILE));
if (fd < 0) {
diff --git a/verity/fec/main.cpp b/verity/fec/main.cpp
index 50d807e2..0675fd6c 100644
--- a/verity/fec/main.cpp
+++ b/verity/fec/main.cpp
@@ -189,7 +189,7 @@ static int encode(image& ctx, const std::vector<std::string>& inp_filenames,
size_t n = 1;
- for (auto fn : inp_filenames) {
+ for (const auto& fn : inp_filenames) {
INFO("\t%zu: '%s'\n", n++, fn.c_str());
}