Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1320)

Unified Diff: base/command_line.cc

Issue 1043803002: Use StringPiece for base CommandLine::HasSwitch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/command_line.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/command_line.cc
diff --git a/base/command_line.cc b/base/command_line.cc
index 6125667d3ec8e66dcead5ec8147fd5879bd6ad48..f6c435391587f10e075df02a2b486e4cf86c01a5 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -93,14 +93,14 @@ void AppendSwitchesAndArguments(CommandLine* command_line,
}
}
-// Lowercase switches for backwards compatiblity *on Windows*.
+// Lowercase switches for backwards compatibility *on Windows*.
#if defined(OS_WIN)
-std::string LowerASCIIOnWindows(const std::string& string) {
- return StringToLowerASCII(string);
+std::string LowerASCIIOnWindows(const base::StringPiece& string) {
+ return StringToLowerASCII(string.as_string());
}
#elif defined(OS_POSIX)
-const std::string& LowerASCIIOnWindows(const std::string& string) {
- return string;
+std::string LowerASCIIOnWindows(const base::StringPiece& string) {
+ return string.as_string();
}
#endif
@@ -262,7 +262,7 @@ void CommandLine::SetProgram(const FilePath& program) {
TrimWhitespace(program.value(), TRIM_ALL, &argv_[0]);
}
-bool CommandLine::HasSwitch(const std::string& switch_string) const {
+bool CommandLine::HasSwitch(const base::StringPiece& switch_string) const {
return switches_.find(LowerASCIIOnWindows(switch_string)) != switches_.end();
}
« no previous file with comments | « base/command_line.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698