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

Unified Diff: base/command_line.cc

Issue 1007283012: Provide CommandLine::HasSwitch(const char*) to save 76kB in sizes perf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: skip the case optimization 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
« base/command_line.h ('K') | « 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..48d44f99bac7244ee085f778971256cb19dd073f 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -266,6 +266,10 @@ bool CommandLine::HasSwitch(const std::string& switch_string) const {
return switches_.find(LowerASCIIOnWindows(switch_string)) != switches_.end();
}
+bool CommandLine::HasSwitch(const char string_constant[]) const {
+ return HasSwitch(std::string(string_constant));
+}
+
std::string CommandLine::GetSwitchValueASCII(
const std::string& switch_string) const {
StringType value = GetSwitchValueNative(switch_string);
« base/command_line.h ('K') | « base/command_line.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698