aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHector Dearman <hjd@google.com>2021-02-01 11:15:31 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-02-01 11:15:31 +0000
commit46bd1f17b92e0b6de595be4c771afcd0f42fc47d (patch)
treee300306e091180cc15c28fcbe2a125b5258098a9
parentdd5f5806985f9140ee3011e2451676e2b677e880 (diff)
parent9f5b5bfebc75f8069539990bdc69ba8e8bcaa70d (diff)
downloadperfetto-46bd1f17b92e0b6de595be4c771afcd0f42fc47d.tar.gz
Merge "upkeep: Use char overload of r?find() where possible"
-rw-r--r--src/perfetto_cmd/config.cc2
-rw-r--r--src/profiling/deobfuscator.cc4
-rw-r--r--src/trace_processor/trace_processor_impl.cc2
-rw-r--r--src/trace_processor/trace_processor_shell.cc6
-rw-r--r--src/traced/probes/ftrace/ftrace_config_muxer.cc2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/perfetto_cmd/config.cc b/src/perfetto_cmd/config.cc
index 27e7a4cb0..1dbba970d 100644
--- a/src/perfetto_cmd/config.cc
+++ b/src/perfetto_cmd/config.cc
@@ -116,7 +116,7 @@ bool CreateConfigFromOptions(const ConfigOptions& options,
std::vector<std::string> atrace_apps = options.atrace_apps;
for (const auto& category : options.categories) {
- if (category.find("/") == std::string::npos) {
+ if (category.find('/') == std::string::npos) {
atrace_categories.push_back(category);
} else {
ftrace_events.push_back(category);
diff --git a/src/profiling/deobfuscator.cc b/src/profiling/deobfuscator.cc
index 193681f3c..2a7b9c018 100644
--- a/src/profiling/deobfuscator.cc
+++ b/src/profiling/deobfuscator.cc
@@ -117,11 +117,11 @@ base::Optional<ProguardMember> ParseMember(std::string line) {
}
ProguardMemberType member_type;
- auto paren_idx = deobfuscated_name.find("(");
+ auto paren_idx = deobfuscated_name.find('(');
if (paren_idx != std::string::npos) {
member_type = ProguardMemberType::kMethod;
deobfuscated_name = deobfuscated_name.substr(0, paren_idx);
- auto colon_idx = type_name.find(":");
+ auto colon_idx = type_name.find(':');
if (colon_idx != std::string::npos) {
type_name = type_name.substr(colon_idx + 1);
}
diff --git a/src/trace_processor/trace_processor_impl.cc b/src/trace_processor/trace_processor_impl.cc
index 13994fda7..35fb3a047 100644
--- a/src/trace_processor/trace_processor_impl.cc
+++ b/src/trace_processor/trace_processor_impl.cc
@@ -957,7 +957,7 @@ util::Status TraceProcessorImpl::RegisterMetric(const std::string& path,
return util::OkStatus();
}
- auto sep_idx = path.rfind("/");
+ auto sep_idx = path.rfind('/');
std::string basename =
sep_idx == std::string::npos ? path : path.substr(sep_idx + 1);
diff --git a/src/trace_processor/trace_processor_shell.cc b/src/trace_processor/trace_processor_shell.cc
index c2755a922..144810e29 100644
--- a/src/trace_processor/trace_processor_shell.cc
+++ b/src/trace_processor/trace_processor_shell.cc
@@ -240,7 +240,7 @@ util::Status PrintStats() {
}
util::Status ExportTraceToDatabase(const std::string& output_name) {
- PERFETTO_CHECK(output_name.find("'") == std::string::npos);
+ PERFETTO_CHECK(output_name.find('\'') == std::string::npos);
{
base::ScopedFile fd(base::OpenFile(output_name, O_CREAT | O_RDWR, 0600));
if (!fd)
@@ -265,7 +265,7 @@ util::Status ExportTraceToDatabase(const std::string& output_name) {
"SELECT name FROM sqlite_master WHERE type='table'");
for (uint32_t rows = 0; tables_it.Next(); rows++) {
std::string table_name = tables_it.Get(0).string_value;
- PERFETTO_CHECK(table_name.find("'") == std::string::npos);
+ PERFETTO_CHECK(table_name.find('\'') == std::string::npos);
std::string export_sql = "CREATE TABLE perfetto_export." + table_name +
" AS SELECT * FROM " + table_name;
@@ -957,7 +957,7 @@ util::Status RunMetrics(const CommandLineOptions& options) {
const std::string& metric_or_path = metrics[i];
// If there is no extension, we assume it is a builtin metric.
- auto ext_idx = metric_or_path.rfind(".");
+ auto ext_idx = metric_or_path.rfind('.');
if (ext_idx == std::string::npos)
continue;
diff --git a/src/traced/probes/ftrace/ftrace_config_muxer.cc b/src/traced/probes/ftrace/ftrace_config_muxer.cc
index 56f61f0f6..597fac44f 100644
--- a/src/traced/probes/ftrace/ftrace_config_muxer.cc
+++ b/src/traced/probes/ftrace/ftrace_config_muxer.cc
@@ -61,7 +61,7 @@ std::set<GroupAndName> ReadEventsInGroupFromFs(
std::pair<std::string, std::string> EventToStringGroupAndName(
const std::string& event) {
- auto slash_pos = event.find("/");
+ auto slash_pos = event.find('/');
if (slash_pos == std::string::npos)
return std::make_pair("", event);
return std::make_pair(event.substr(0, slash_pos),