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

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 167123002: Simpler return value from HashTable::add()/HashMap::add() and others (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderRegion.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index a055b5ee4ce817dc1a58f7deff8bbb6664df9d92..75e63601a0aee071958e98572403083279c73841 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -2389,12 +2389,15 @@ void RenderObject::addLayerHitTestRects(LayerHitTestRects& layerRects, const Ren
const size_t maxRectsPerLayer = 100;
LayerHitTestRects::iterator iter = layerRects.find(currentLayer);
+ Vector<WebCore::LayoutRect>* iterValue;
if (iter == layerRects.end())
- iter = layerRects.add(currentLayer, Vector<LayoutRect>()).iterator;
+ iterValue = &layerRects.add(currentLayer, Vector<LayoutRect>()).storedValue->value;
+ else
+ iterValue = &iter->value;
for (size_t i = 0; i < ownRects.size(); i++) {
if (!containerRect.contains(ownRects[i])) {
- iter->value.append(ownRects[i]);
- if (iter->value.size() > maxRectsPerLayer) {
+ iterValue->append(ownRects[i]);
+ if (iterValue->size() > maxRectsPerLayer) {
// Just mark the entire layer instead, and switch to walking the layer
// tree instead of the render tree.
layerRects.remove(currentLayer);
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderRegion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698