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

Unified Diff: third_party/WebKit/Source/wtf/ListHashSet.h

Issue 1813693002: Fix ListHashSet::AddResult storing a Node* instead of a ValueType*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | third_party/WebKit/Source/wtf/ListHashSetTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/ListHashSet.h
diff --git a/third_party/WebKit/Source/wtf/ListHashSet.h b/third_party/WebKit/Source/wtf/ListHashSet.h
index c959833af60dc77577aa9ae53c2a9cf34eba9f24..85098bd99055c529a9e86a943d946996cdc872b6 100644
--- a/third_party/WebKit/Source/wtf/ListHashSet.h
+++ b/third_party/WebKit/Source/wtf/ListHashSet.h
@@ -87,13 +87,18 @@ public:
friend class ListHashSetReverseIterator<ListHashSet>;
friend class ListHashSetConstReverseIterator<ListHashSet>;
- template <typename ValueType> struct HashTableAddResult final {
+ struct AddResult final {
STACK_ALLOCATED();
- HashTableAddResult(Node* storedValue, bool isNewEntry) : storedValue(storedValue), isNewEntry(isNewEntry) { }
- Node* storedValue;
+ friend class ListHashSet<ValueArg, inlineCapacity, HashArg, AllocatorArg>;
+ AddResult(Node* node, bool isNewEntry)
+ : storedValue(&node->m_value)
+ , isNewEntry(isNewEntry)
+ , m_node(node) { }
+ ValueType* storedValue;
bool isNewEntry;
+ private:
+ Node* m_node;
};
- typedef HashTableAddResult<ValueType> AddResult;
ListHashSet();
ListHashSet(const ListHashSet&);
@@ -841,7 +846,7 @@ typename ListHashSet<T, inlineCapacity, U, V>::AddResult ListHashSet<T, inlineCa
template <typename T, size_t inlineCapacity, typename U, typename V>
typename ListHashSet<T, inlineCapacity, U, V>::iterator ListHashSet<T, inlineCapacity, U, V>::addReturnIterator(ValuePassInType value)
{
- return makeIterator(add(value).storedValue);
+ return makeIterator(add(value).m_node);
}
template <typename T, size_t inlineCapacity, typename U, typename V>
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/ListHashSetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698