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

Unified Diff: chromeos/network/onc/onc_mapper.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various builds. Created 4 years, 7 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
Index: chromeos/network/onc/onc_mapper.cc
diff --git a/chromeos/network/onc/onc_mapper.cc b/chromeos/network/onc/onc_mapper.cc
index d5df15ef23c4a9465fa590be0c77f4260e306d2e..1da58015c39f6b44354f8e4ea7fbb14e44da0210 100644
--- a/chromeos/network/onc/onc_mapper.cc
+++ b/chromeos/network/onc/onc_mapper.cc
@@ -116,10 +116,7 @@ std::unique_ptr<base::ListValue> Mapper::MapArray(
std::unique_ptr<base::ListValue> result_array(new base::ListValue);
int original_index = 0;
- for (base::ListValue::const_iterator it = onc_array.begin();
- it != onc_array.end(); ++it, ++original_index) {
- const base::Value* entry = *it;
-
+ for (const auto& entry : onc_array) {
danakj 2016/05/24 20:08:35 You need to ++original_index still. wtb unit tests
dcheng 2016/05/24 20:39:02 Done. Clever code is clever.
std::unique_ptr<base::Value> result_entry;
result_entry = MapEntry(original_index,
*array_signature.onc_array_entry_signature,

Powered by Google App Engine
This is Rietveld 408576698