summaryrefslogtreecommitdiff
path: root/startop
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2020-02-11 14:27:11 -0800
committerChih-Hung Hsieh <chh@google.com>2020-02-11 14:27:11 -0800
commitf2ef6579f2fe70ddca7fa3d443b3780d0264eb88 (patch)
tree831808e5fd62fe0f303c25fd3e509951cce0f2e8 /startop
parent668daf03416525dbcd96f2a06b2fd5dccb7cec13 (diff)
Fix clang-tidy performance-faster-string-find warnings
Bug: 30411878 Test: build with WITH_TIDY=1 Change-Id: I7fd815aa401fbcaff97b772f3ba5d6f1d2034011
Diffstat (limited to 'startop')
-rw-r--r--startop/view_compiler/dex_layout_compiler.cc4
-rw-r--r--startop/view_compiler/util.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/startop/view_compiler/dex_layout_compiler.cc b/startop/view_compiler/dex_layout_compiler.cc
index cb820f8f20fb..bddb8aa6716a 100644
--- a/startop/view_compiler/dex_layout_compiler.cc
+++ b/startop/view_compiler/dex_layout_compiler.cc
@@ -118,7 +118,7 @@ namespace {
std::string ResolveName(const std::string& name) {
if (name == "View") return "android.view.View";
if (name == "ViewGroup") return "android.view.ViewGroup";
- if (name.find(".") == std::string::npos) {
+ if (name.find('.') == std::string::npos) {
return StringPrintf("android.widget.%s", name.c_str());
}
return name;
@@ -205,4 +205,4 @@ void DexViewBuilder::PopViewStack() {
view_stack_.pop_back();
}
-} // namespace startop \ No newline at end of file
+} // namespace startop
diff --git a/startop/view_compiler/util.cc b/startop/view_compiler/util.cc
index a0637e6da32f..c34d7b059cfc 100644
--- a/startop/view_compiler/util.cc
+++ b/startop/view_compiler/util.cc
@@ -23,13 +23,13 @@ namespace util {
// TODO: see if we can borrow this from somewhere else, like aapt2.
string FindLayoutNameFromFilename(const string& filename) {
- size_t start = filename.rfind("/");
+ size_t start = filename.rfind('/');
if (start == string::npos) {
start = 0;
} else {
start++; // advance past '/' character
}
- size_t end = filename.find(".", start);
+ size_t end = filename.find('.', start);
return filename.substr(start, end - start);
}