diff options
author | cmumford <cmumford@chromium.org> | 2016-03-14 15:46:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-14 22:47:54 +0000 |
commit | f755705a429d313d57c012895adb033aba5c4529 (patch) | |
tree | 6f57695ef03125bee0e08e518d6fddb0251033ac /extensions/browser/value_store | |
parent | e2f999841cbfba72585eef56746ab019c0db3b54 (diff) | |
download | chromium_src-f755705a429d313d57c012895adb033aba5c4529.zip chromium_src-f755705a429d313d57c012895adb033aba5c4529.tar.gz chromium_src-f755705a429d313d57c012895adb033aba5c4529.tar.bz2 |
Extensions: Minor cleanup, formatting/lint errors.
1. Added missing STL header includes.
2. Whitespace fixup.
3. Proper ordering of forward declarations and header includes.
4. Using FRIEND_TEST_ALL_PREFIXES to eliminate test-only method.
5. Switched to range-based for loops.
Review URL: https://codereview.chromium.org/1786163002
Cr-Commit-Position: refs/heads/master@{#381098}
Diffstat (limited to 'extensions/browser/value_store')
-rw-r--r-- | extensions/browser/value_store/leveldb_value_store.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/extensions/browser/value_store/leveldb_value_store.cc b/extensions/browser/value_store/leveldb_value_store.cc index db3e30a..e2529ce 100644 --- a/extensions/browser/value_store/leveldb_value_store.cc +++ b/extensions/browser/value_store/leveldb_value_store.cc @@ -177,14 +177,13 @@ ValueStore::ReadResult LeveldbValueStore::Get( scoped_ptr<base::DictionaryValue> settings(new base::DictionaryValue()); - for (std::vector<std::string>::const_iterator it = keys.begin(); - it != keys.end(); ++it) { + for (const std::string& key : keys) { scoped_ptr<base::Value> setting; - status.Merge(ReadFromDb(*it, &setting)); + status.Merge(ReadFromDb(key, &setting)); if (!status.ok()) return MakeReadResult(status); if (setting) - settings->SetWithoutPathExpansion(*it, setting.release()); + settings->SetWithoutPathExpansion(key, setting.release()); } return MakeReadResult(std::move(settings), status); @@ -291,16 +290,15 @@ ValueStore::WriteResult LeveldbValueStore::Remove( leveldb::WriteBatch batch; scoped_ptr<ValueStoreChangeList> changes(new ValueStoreChangeList()); - for (std::vector<std::string>::const_iterator it = keys.begin(); - it != keys.end(); ++it) { + for (const std::string& key : keys) { scoped_ptr<base::Value> old_value; - status.Merge(ReadFromDb(*it, &old_value)); + status.Merge(ReadFromDb(key, &old_value)); if (!status.ok()) return MakeWriteResult(status); if (old_value) { - changes->push_back(ValueStoreChange(*it, old_value.release(), NULL)); - batch.Delete(*it); + changes->push_back(ValueStoreChange(key, old_value.release(), NULL)); + batch.Delete(key); } } |