Commit b9f8df0a authored by gavinp@chromium.org's avatar gavinp@chromium.org

Clean up Simple Index handling of removed entries.

The loop to remove entries seemed a bit silly going through both lists;
it's a bit more clear to do it on the merged set.

R=rdsmith,pliard
BUG=None

Review URL: https://chromiumcodereview.appspot.com/22430014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220618 0039d316-1c4b-4281-b951-d872f2087c98
parent 1b163742
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment