[clang-tidy] Apply performance-faster-string-find fixes.
This CL applies clang-tidy's performance-faster-string-find [1] on the WebRTC codebase. All changes in this CL are automatically generated by both clang-tidy and 'git cl format'. [1] - https://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html Bug: webrtc:10252 Change-Id: I4b8c0396836f3c325488e37d97037fa04742a5d2 Reviewed-on: https://webrtc-review.googlesource.com/c/120047 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26423}
This commit is contained in:
committed by
Commit Bot
parent
190713c7cd
commit
37ec55e2bb
@ -26,12 +26,12 @@ void CommandLineParser::Init(int argc, char** argv) {
|
||||
}
|
||||
|
||||
bool CommandLineParser::IsStandaloneFlag(std::string flag) {
|
||||
return flag.find("=") == std::string::npos;
|
||||
return flag.find('=') == std::string::npos;
|
||||
}
|
||||
|
||||
bool CommandLineParser::IsFlagWellFormed(std::string flag) {
|
||||
size_t dash_pos = flag.find("--");
|
||||
size_t equal_pos = flag.find("=");
|
||||
size_t equal_pos = flag.find('=');
|
||||
if (dash_pos != 0) {
|
||||
fprintf(stderr, "Wrong switch format: %s\n", flag.c_str());
|
||||
fprintf(stderr, "Flag doesn't start with --\n");
|
||||
@ -52,7 +52,7 @@ bool CommandLineParser::IsFlagWellFormed(std::string flag) {
|
||||
|
||||
std::string CommandLineParser::GetCommandLineFlagName(std::string flag) {
|
||||
size_t dash_pos = flag.find("--");
|
||||
size_t equal_pos = flag.find("=");
|
||||
size_t equal_pos = flag.find('=');
|
||||
if (equal_pos == std::string::npos) {
|
||||
return flag.substr(dash_pos + 2);
|
||||
} else {
|
||||
@ -61,7 +61,7 @@ std::string CommandLineParser::GetCommandLineFlagName(std::string flag) {
|
||||
}
|
||||
|
||||
std::string CommandLineParser::GetCommandLineFlagValue(std::string flag) {
|
||||
size_t equal_pos = flag.find("=");
|
||||
size_t equal_pos = flag.find('=');
|
||||
if (equal_pos == std::string::npos) {
|
||||
return "";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user