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: Source/core/css/resolver/MatchedPropertiesCache.cpp

Issue 256743005: Add removeAll method to sets and maps and use them (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved implementation of removeAll to HashTable.h and shared it. Also added it to LinkedHashSet Created 6 years, 8 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 | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/MatchedPropertiesCache.cpp
diff --git a/Source/core/css/resolver/MatchedPropertiesCache.cpp b/Source/core/css/resolver/MatchedPropertiesCache.cpp
index 56a7f5bdd47d03e2da6da44cdd4461d78c4bca4f..469fa3c9c2fb3b0fc99395faa735e8ff61adf3db 100644
--- a/Source/core/css/resolver/MatchedPropertiesCache.cpp
+++ b/Source/core/css/resolver/MatchedPropertiesCache.cpp
@@ -117,8 +117,7 @@ void MatchedPropertiesCache::clearViewportDependent()
if (cacheItem->renderStyle->hasViewportUnits())
toRemove.append(it->key);
}
- for (size_t i = 0; i < toRemove.size(); ++i)
- m_cache.remove(toRemove[i]);
+ m_cache.removeAll(toRemove);
}
void MatchedPropertiesCache::sweep(Timer<MatchedPropertiesCache>*)
@@ -139,9 +138,7 @@ void MatchedPropertiesCache::sweep(Timer<MatchedPropertiesCache>*)
}
}
}
- for (size_t i = 0; i < toRemove.size(); ++i)
- m_cache.remove(toRemove[i]);
-
+ m_cache.removeAll(toRemove);
m_additionsSinceLastSweep = 0;
}
« no previous file with comments | « no previous file | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698