From f2ef6579f2fe70ddca7fa3d443b3780d0264eb88 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Tue, 11 Feb 2020 14:27:11 -0800 Subject: Fix clang-tidy performance-faster-string-find warnings Bug: 30411878 Test: build with WITH_TIDY=1 Change-Id: I7fd815aa401fbcaff97b772f3ba5d6f1d2034011 --- startop/view_compiler/util.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'startop/view_compiler/util.cc') 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); } -- cgit v1.2.3