Index: base/feature_list.cc |
diff --git a/base/feature_list.cc b/base/feature_list.cc |
index 353136c12be5c73516c5c89a644558a60fba336b..8dbde97eb4b2c356ac1aad0055e7230a77fced18 100644 |
--- a/base/feature_list.cc |
+++ b/base/feature_list.cc |
@@ -228,9 +228,9 @@ FieldTrial* FeatureList::GetFieldTrial(const Feature& feature) { |
} |
// static |
-std::vector<std::string> FeatureList::SplitFeatureListString( |
- const std::string& input) { |
- return SplitString(input, ",", TRIM_WHITESPACE, SPLIT_WANT_NONEMPTY); |
+std::vector<base::StringPiece> FeatureList::SplitFeatureListString( |
+ base::StringPiece input) { |
+ return SplitStringPiece(input, ",", TRIM_WHITESPACE, SPLIT_WANT_NONEMPTY); |
} |
// static |
@@ -339,8 +339,8 @@ FieldTrial* FeatureList::GetAssociatedFieldTrial(const Feature& feature) { |
void FeatureList::RegisterOverridesFromCommandLine( |
const std::string& feature_list, |
OverrideState overridden_state) { |
- for (const auto& value : SplitFeatureListString(feature_list)) { |
- StringPiece feature_name(value); |
+ for (auto value : SplitFeatureListString(feature_list)) { |
dcheng
2017/03/15 10:02:36
Hmmm... StringPiece are pretty cheap, but I suspec
Matt Giuca
2017/03/17 00:16:27
I'm just going by the summary at the top of string
dcheng
2017/03/17 05:28:34
Mind pasting the assembly somewhere?
(I know it's
Matt Giuca
2017/03/21 08:28:48
OK I did a deeper analysis. I'm not sure about the
Matt Giuca
2017/03/27 03:24:58
After an extensive analysis, my conclusion was tha
|
+ StringPiece feature_name = value; |
base::FieldTrial* trial = nullptr; |
// The entry may be of the form FeatureName<FieldTrialName - in which case, |
@@ -348,7 +348,7 @@ void FeatureList::RegisterOverridesFromCommandLine( |
std::string::size_type pos = feature_name.find('<'); |
if (pos != std::string::npos) { |
feature_name.set(value.data(), pos); |
- trial = base::FieldTrialList::Find(value.substr(pos + 1)); |
+ trial = base::FieldTrialList::Find(value.substr(pos + 1).as_string()); |
} |
RegisterOverride(feature_name, overridden_state, trial); |