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

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResource.cpp

Issue 2045883002: Clean up markClientsAndObserversFinished(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix sign mismatch comparison Created 4 years, 6 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 | third_party/WebKit/Source/core/fetch/Resource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/ImageResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
index 30b0ffbd6d960038e38cc3048880e140b5680f80..e43d51498f6db6fdf8dba6cf48b9fa9d7e7ae8ab 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -106,13 +106,10 @@ void ImageResource::checkNotify()
void ImageResource::markClientsAndObserversFinished()
{
- while (!m_observers.isEmpty()) {
- HashCountedSet<ImageResourceObserver*>::iterator it = m_observers.begin();
- for (int i = it->value; i; i--) {
- m_finishedObservers.add(it->key);
- m_observers.remove(it);
- }
- }
+ HashCountedSet<ImageResourceObserver*> observers;
+ m_observers.swap(observers);
+ for (const auto& it : observers)
+ m_finishedObservers.add(it.key, it.value);
Resource::markClientsAndObserversFinished();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/Resource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698