From 73da05d35403a0c3909edcf5744e99b8f786a61f Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 27 Jul 2016 16:12:54 -0700 Subject: [PATCH] Fix clang-tidy performance warnings in fs_mgr. * Use const reference type for for-loop index variables to avoid unnecessary copy. Bug: 30413223 Change-Id: I5514384ef3af77c00aa3e8417acd8d70981e0afb Test: build with WITH_TIDY=1 --- fs_mgr/fs_mgr_verity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs_mgr/fs_mgr_verity.cpp b/fs_mgr/fs_mgr_verity.cpp index 25b023e0c..67104cc3a 100644 --- a/fs_mgr/fs_mgr_verity.cpp +++ b/fs_mgr/fs_mgr_verity.cpp @@ -858,7 +858,7 @@ static void update_verity_table_blk_device(char *blk_device, char **table) std::string result, word; auto tokens = android::base::Split(*table, " "); - for (const auto token : tokens) { + for (const auto& token : tokens) { if (android::base::StartsWith(token, "/dev/block/") && android::base::StartsWith(blk_device, token.c_str())) { word = blk_device;