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

Unified Diff: Source/core/dom/NodeRareData.h

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/Node.cpp ('k') | Source/core/dom/PresentationAttributeStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeRareData.h
diff --git a/Source/core/dom/NodeRareData.h b/Source/core/dom/NodeRareData.h
index 62974e5d6f4399a94d4b17fbd562fef56af216d1..3572d141549c5367f7c0f0895db8ec6e5b22b927 100644
--- a/Source/core/dom/NodeRareData.h
+++ b/Source/core/dom/NodeRareData.h
@@ -101,10 +101,10 @@ public:
{
NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(collectionType, name), 0);
if (!result.isNewEntry)
- return static_cast<T*>(result.iterator->value);
+ return static_cast<T*>(result.storedValue->value);
RefPtr<T> list = T::create(node, collectionType, name);
- result.iterator->value = list.get();
+ result.storedValue->value = list.get();
return list.release();
}
@@ -113,10 +113,10 @@ public:
{
NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(collectionType, starAtom), 0);
if (!result.isNewEntry)
- return static_cast<T*>(result.iterator->value);
+ return static_cast<T*>(result.storedValue->value);
RefPtr<T> list = T::create(node, collectionType);
- result.iterator->value = list.get();
+ result.storedValue->value = list.get();
return list.release();
}
@@ -131,10 +131,10 @@ public:
QualifiedName name(nullAtom, localName, namespaceURI);
TagCollectionCacheNS::AddResult result = m_tagCollectionCacheNS.add(name, 0);
if (!result.isNewEntry)
- return result.iterator->value;
+ return result.storedValue->value;
RefPtr<TagCollection> list = TagCollection::create(node, namespaceURI, localName);
- result.iterator->value = list.get();
+ result.storedValue->value = list.get();
return list.release();
}
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/PresentationAttributeStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698