Commit 340d4610 authored by reveman's avatar reveman Committed by Commit bot

base: Use range-based for loops in DiscardableMemoryManager.

BUG=422953
TBR=danakj@chromium.org

Review URL: https://codereview.chromium.org/652663005

Cr-Commit-Position: refs/heads/master@{#299343}
parent f165e0a8
......@@ -5,6 +5,7 @@
#include "base/memory/discardable_memory_manager.h"
#include "base/bind.h"
#include "base/containers/adapters.h"
#include "base/containers/hash_tables.h"
#include "base/containers/mru_cache.h"
#include "base/debug/crash_logging.h"
......@@ -177,11 +178,9 @@ void DiscardableMemoryManager::
lock_.AssertAcquired();
size_t bytes_allocated_before_purging = bytes_allocated_;
for (AllocationMap::reverse_iterator it = allocations_.rbegin();
it != allocations_.rend();
++it) {
Allocation* allocation = it->first;
AllocationInfo* info = &it->second;
for (auto& entry : base::Reversed(allocations_)) {
Allocation* allocation = entry.first;
AllocationInfo* info = &entry.second;
if (bytes_allocated_ <= limit)
break;
......
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