summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-03-08 02:53:54 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-03-08 02:53:54 +0000
commit27ce6edfb81875dceb1b01b2d634900ab214c4ee (patch)
tree4302cb5fb9c1cc55afd9eed812f97acaa1ac861c
parent0b922984847bda4c0e00f07dc404664909a1fcc0 (diff)
parent724846d815b4474dc3cba3f77731b2b69664ecbf (diff)
downloadextras-27ce6edfb81875dceb1b01b2d634900ab214c4ee.tar.gz
Merge "simpleperf: fix an error using std::string."
-rw-r--r--simpleperf/tracing.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/simpleperf/tracing.cpp b/simpleperf/tracing.cpp
index 884a883c..966bbd0e 100644
--- a/simpleperf/tracing.cpp
+++ b/simpleperf/tracing.cpp
@@ -295,7 +295,7 @@ static TracingField ParseTracingField(const std::string& s) {
} else if (s[i] == ';') {
value = s.substr(start, i - start);
if (name == "field") {
- size_t pos = value.find_first_of('[');
+ size_t pos = value.find('[');
if (pos == std::string::npos) {
field.name = value;
field.elem_count = 1;
@@ -330,20 +330,20 @@ std::vector<TracingFormat> TracingFile::LoadTracingFormatsFromEventFiles()
FormatParsingState state = FormatParsingState::READ_NAME;
for (const auto& s : strs) {
if (state == FormatParsingState::READ_NAME) {
- size_t pos = s.find_first_of("name:");
+ size_t pos = s.find("name:");
if (pos != std::string::npos) {
format.name = android::base::Trim(s.substr(pos + strlen("name:")));
state = FormatParsingState::READ_ID;
}
} else if (state == FormatParsingState::READ_ID) {
- size_t pos = s.find_first_of("ID:");
+ size_t pos = s.find("ID:");
if (pos != std::string::npos) {
format.id =
strtoull(s.substr(pos + strlen("ID:")).c_str(), nullptr, 10);
state = FormatParsingState::READ_FIELDS;
}
} else if (state == FormatParsingState::READ_FIELDS) {
- size_t pos = s.find_first_of("field:");
+ size_t pos = s.find("field:");
if (pos != std::string::npos) {
TracingField field = ParseTracingField(s);
format.fields.push_back(field);