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

Unified Diff: net/disk_cache/simple/simple_index.cc

Issue 22430014: Clean up Simple Index handling of removed entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove one redundant specification Created 7 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_index.cc
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc
index 97b3be462d436e19ed7075b61fed60a12ce3a0cb..9d2fd17ea8a4d19031315cd9a3ad4eed5ac45ad6 100644
--- a/net/disk_cache/simple/simple_index.cc
+++ b/net/disk_cache/simple/simple_index.cc
@@ -383,14 +383,13 @@ void SimpleIndex::MergeInitializingSet(
DCHECK(io_thread_checker_.CalledOnValidThread());
DCHECK(load_result->did_load);
- SimpleIndex::EntrySet* index_file_entries = &load_result->entries;
- // First, remove the entries that are in the |removed_entries_| from both
- // sets.
- for (base::hash_set<uint64>::const_iterator it =
- removed_entries_.begin(); it != removed_entries_.end(); ++it) {
- entries_set_.erase(*it);
+ EntrySet* index_file_entries = &load_result->entries;
+
+ for (base::hash_set<uint64>::const_iterator it = removed_entries_.begin();
+ it != removed_entries_.end(); ++it) {
index_file_entries->erase(*it);
}
+ removed_entries_.clear();
for (EntrySet::const_iterator it = entries_set_.begin();
it != entries_set_.end(); ++it) {
@@ -411,7 +410,6 @@ void SimpleIndex::MergeInitializingSet(
entries_set_.swap(*index_file_entries);
cache_size_ = merged_cache_size;
initialized_ = true;
- removed_entries_.clear();
// The actual IO is asynchronous, so calling WriteToDisk() shouldn't slow the
// merge down much.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698