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

Unified Diff: Source/core/dom/PresentationAttributeStyle.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/dom/NodeRareData.h ('k') | Source/core/dom/QualifiedName.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/PresentationAttributeStyle.cpp
diff --git a/Source/core/dom/PresentationAttributeStyle.cpp b/Source/core/dom/PresentationAttributeStyle.cpp
index e9ced659b2953d6550d27521016435fe4059a63d..ce45b4be90b0300ddb4f1a8ab1dee48e850b4222 100644
--- a/Source/core/dom/PresentationAttributeStyle.cpp
+++ b/Source/core/dom/PresentationAttributeStyle.cpp
@@ -163,18 +163,18 @@ PassRefPtr<StylePropertySet> computePresentationAttributeStyle(Element& element)
unsigned cacheHash = computePresentationAttributeCacheHash(cacheKey);
- PresentationAttributeCache::iterator cacheIterator;
+ PresentationAttributeCache::ValueType* cacheValue;
if (cacheHash) {
- cacheIterator = presentationAttributeCache().add(cacheHash, nullptr).iterator;
- if (cacheIterator->value && cacheIterator->value->key != cacheKey)
+ cacheValue = presentationAttributeCache().add(cacheHash, nullptr).storedValue;
+ if (cacheValue->value && cacheValue->value->key != cacheKey)
cacheHash = 0;
} else {
- cacheIterator = presentationAttributeCache().end();
+ cacheValue = 0;
}
RefPtr<StylePropertySet> style;
- if (cacheHash && cacheIterator->value) {
- style = cacheIterator->value->value;
+ if (cacheHash && cacheValue->value) {
+ style = cacheValue->value->value;
cacheCleaner.didHitPresentationAttributeCache();
} else {
style = MutableStylePropertySet::create(element.isSVGElement() ? SVGAttributeMode : HTMLAttributeMode);
@@ -185,7 +185,7 @@ PassRefPtr<StylePropertySet> computePresentationAttributeStyle(Element& element)
}
}
- if (!cacheHash || cacheIterator->value)
+ if (!cacheHash || cacheValue->value)
return style.release();
OwnPtr<PresentationAttributeCacheEntry> newEntry = adoptPtr(new PresentationAttributeCacheEntry);
@@ -199,7 +199,7 @@ PassRefPtr<StylePropertySet> computePresentationAttributeStyle(Element& element)
presentationAttributeCache().clear();
presentationAttributeCache().set(cacheHash, newEntry.release());
} else {
- cacheIterator->value = newEntry.release();
+ cacheValue->value = newEntry.release();
}
return style.release();
« no previous file with comments | « Source/core/dom/NodeRareData.h ('k') | Source/core/dom/QualifiedName.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698