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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.cpp

Issue 2712703002: DisplayItemClient: avoid hash table temporaries when iterating. (Closed)
Patch Set: Created 3 years, 10 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: third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.cpp b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.cpp
index 009cce510506c3b0f72cf782b69ec0114cacacaf..1748aa25f4cb352d0356e2a739e5276ed660aa05 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.cpp
@@ -23,7 +23,7 @@ HashMap<const void*, HashMap<const DisplayItemClient*, String>>*
DisplayItemClient::DisplayItemClient() {
if (displayItemClientsShouldKeepAlive) {
- for (auto item : *displayItemClientsShouldKeepAlive)
+ for (const auto& item : *displayItemClientsShouldKeepAlive)
CHECK(!item.value.contains(this));
}
if (!liveDisplayItemClients)
@@ -33,7 +33,7 @@ DisplayItemClient::DisplayItemClient() {
DisplayItemClient::~DisplayItemClient() {
if (displayItemClientsShouldKeepAlive) {
- for (auto& item : *displayItemClientsShouldKeepAlive) {
+ for (const auto& item : *displayItemClientsShouldKeepAlive) {
CHECK(!item.value.contains(this))
<< "Short-lived DisplayItemClient: " << item.value.get(this)
<< ". See crbug.com/609218.";
« 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