Optimize calls to std::string::find() and friends for a single char.

The character literal overload is more efficient.

Change-Id: Ia2ec863e3442b87d357c20f932f88e31d40e6524
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2596067
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Eric Astor <epastor@google.com>
This commit is contained in:
Eric Astor 2020-12-16 13:14:40 -05:00 committed by Commit Bot
parent 8bf3cdd977
commit cce6b30149

View File

@ -318,7 +318,7 @@ bool ProcessSnapshotMinidump::InitializeMiscInfo() {
#else
full_version_ = base::UTF16ToUTF8(info.BuildString);
#endif
full_version_ = full_version_.substr(0, full_version_.find(";"));
full_version_ = full_version_.substr(0, full_version_.find(';'));
FALLTHROUGH;
case sizeof(MINIDUMP_MISC_INFO_3):
case sizeof(MINIDUMP_MISC_INFO_2):