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

Unified Diff: base/json/json_parser.cc

Issue 2383013004: Remove some non-essential StringPiece->std::string conversion in base/ (Closed)
Patch Set: address comments Created 4 years, 2 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 | « no previous file | base/values.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_parser.cc
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc
index b1f28b46214eff0d181b1134fb04098d0e025a03..9ce6a2c1e73fa7105402ee84580eb564bcddd700 100644
--- a/base/json/json_parser.cc
+++ b/base/json/json_parser.cc
@@ -151,9 +151,7 @@ class JSONStringValue : public Value {
*out_value = UTF8ToUTF16(string_piece_);
return true;
}
- Value* DeepCopy() const override {
- return new StringValue(string_piece_.as_string());
- }
+ Value* DeepCopy() const override { return new StringValue(string_piece_); }
bool Equals(const Value* other) const override {
std::string other_string;
return other->IsType(TYPE_STRING) && other->GetAsString(&other_string) &&
« no previous file with comments | « no previous file | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698