ART: Fix tidy warnings in patchoat (again)
Fix performance-faster-string-find warning.
Bug: 32619234
Test: WITH_TIDY=1 mmma art/patchoat
Change-Id: Ic8678d140cd8aa9b5c26bcbc48d3e4e326d4e56f
diff --git a/patchoat/patchoat_test.cc b/patchoat/patchoat_test.cc
index 6492b96..79ae987 100644
--- a/patchoat/patchoat_test.cc
+++ b/patchoat/patchoat_test.cc
@@ -405,7 +405,7 @@
std::vector<std::string> patchoat_image_shortened_basenames(patchoat_image_basenames.size());
for (size_t i = 0; i < patchoat_image_basenames.size(); i++) {
patchoat_image_shortened_basenames[i] =
- patchoat_image_basenames[i].substr(patchoat_image_basenames[i].find_last_of("@") + 1);
+ patchoat_image_basenames[i].substr(patchoat_image_basenames[i].find_last_of('@') + 1);
}
ASSERT_EQ(dex2oat_image_basenames, patchoat_image_shortened_basenames);
@@ -515,16 +515,16 @@
std::vector<std::string> rel_shortened_basenames(rel_basenames.size());
std::vector<std::string> relocated_image_shortened_basenames(relocated_image_basenames.size());
for (size_t i = 0; i < rel_basenames.size(); i++) {
- rel_shortened_basenames[i] = rel_basenames[i].substr(rel_basenames[i].find_last_of("@") + 1);
+ rel_shortened_basenames[i] = rel_basenames[i].substr(rel_basenames[i].find_last_of('@') + 1);
rel_shortened_basenames[i] =
- rel_shortened_basenames[i].substr(0, rel_shortened_basenames[i].find("."));
+ rel_shortened_basenames[i].substr(0, rel_shortened_basenames[i].find('.'));
}
for (size_t i = 0; i < relocated_image_basenames.size(); i++) {
relocated_image_shortened_basenames[i] =
- relocated_image_basenames[i].substr(relocated_image_basenames[i].find_last_of("@") + 1);
+ relocated_image_basenames[i].substr(relocated_image_basenames[i].find_last_of('@') + 1);
relocated_image_shortened_basenames[i] =
relocated_image_shortened_basenames[i].substr(
- 0, relocated_image_shortened_basenames[i].find("."));
+ 0, relocated_image_shortened_basenames[i].find('.'));
}
ASSERT_EQ(rel_shortened_basenames, relocated_image_shortened_basenames);
}