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

Unified Diff: base/json/json_parser.cc

Issue 2811043002: Revert of Use base::flat_map for base::Value dictionary storage. (Closed)
Patch Set: Created 3 years, 8 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.h » ('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 be7d21dbb343d7a7afd1f2f24651073e1702ef61..a91038cee986b4bb02a4a1d9c41923c9a92998a2 100644
--- a/base/json/json_parser.cc
+++ b/base/json/json_parser.cc
@@ -344,7 +344,7 @@
return nullptr;
}
- std::vector<Value::DictStorage::value_type> dict_storage;
+ std::unique_ptr<DictionaryValue> dict(new DictionaryValue);
NextChar();
Token token = GetNextToken();
@@ -376,7 +376,7 @@
return nullptr;
}
- dict_storage.emplace_back(key.DestructiveAsString(), std::move(value));
+ dict->SetWithoutPathExpansion(key.AsStringPiece(), std::move(value));
NextChar();
token = GetNextToken();
@@ -393,8 +393,7 @@
}
}
- return MakeUnique<Value>(
- Value::DictStorage(std::move(dict_storage), KEEP_LAST_OF_DUPES));
+ return std::move(dict);
}
std::unique_ptr<Value> JSONParser::ConsumeList() {
« no previous file with comments | « no previous file | base/values.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698