Changeset 203304 in webkit
- Timestamp:
- Jul 15, 2016, 3:25:43 PM (10 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
wtf/ListHashSet.h (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r203303 r203304 1 2016-07-15 Chris Dumez <cdumez@apple.com> 2 3 Add move constructor / assignment operator to ListHashSet 4 https://bugs.webkit.org/show_bug.cgi?id=159837 5 6 Reviewed by Alex Christensen. 7 8 Add move constructor / assignment operator to ListHashSet. 9 10 * wtf/ListHashSet.h: 11 1 12 2016-07-15 Geoffrey Garen <ggaren@apple.com> 2 13 -
trunk/Source/WTF/wtf/ListHashSet.h
r194496 r203304 20 20 */ 21 21 22 #ifndef WTF_ListHashSet_h 23 #define WTF_ListHashSet_h 22 #pragma once 24 23 25 24 #include <wtf/HashSet.h> … … 70 69 typedef HashTableAddResult<iterator> AddResult; 71 70 72 ListHashSet() ;71 ListHashSet() = default; 73 72 ListHashSet(const ListHashSet&); 73 ListHashSet(ListHashSet&&) = default; 74 74 ListHashSet& operator=(const ListHashSet&); 75 ListHashSet& operator=(ListHashSet&&) = default; 75 76 ~ListHashSet(); 76 77 … … 150 151 151 152 HashTable<Node*, Node*, IdentityExtractor, NodeHash, NodeTraits, NodeTraits> m_impl; 152 Node* m_head ;153 Node* m_tail ;153 Node* m_head { nullptr }; 154 Node* m_tail { nullptr }; 154 155 }; 155 156 … … 160 161 ListHashSetNode(T&& value) 161 162 : m_value(std::forward<T>(value)) 162 , m_prev(0)163 , m_next(0)164 163 { 165 164 } 166 165 167 166 ValueArg m_value; 168 ListHashSetNode* m_prev ;169 ListHashSetNode* m_next ;167 ListHashSetNode* m_prev { nullptr }; 168 ListHashSetNode* m_next { nullptr }; 170 169 }; 171 170 … … 261 260 const_iterator& operator++() 262 261 { 263 ASSERT(m_position != 0);262 ASSERT(m_position); 264 263 m_position = m_position->m_next; 265 264 return *this; … … 308 307 309 308 template<typename T, typename U> 310 inline ListHashSet<T, U>::ListHashSet()311 : m_head(0)312 , m_tail(0)313 {314 }315 316 template<typename T, typename U>317 309 inline ListHashSet<T, U>::ListHashSet(const ListHashSet& other) 318 : m_head(0)319 , m_tail(0)320 310 { 321 311 for (auto it = other.begin(), end = other.end(); it != end; ++it) … … 603 593 deleteAllNodes(); 604 594 m_impl.clear(); 605 m_head = 0;606 m_tail = 0;595 m_head = nullptr; 596 m_tail = nullptr; 607 597 } 608 598 … … 638 628 { 639 629 node->m_prev = m_tail; 640 node->m_next = 0;630 node->m_next = nullptr; 641 631 642 632 if (m_tail) { … … 654 644 void ListHashSet<T, U>::prependNode(Node* node) 655 645 { 656 node->m_prev = 0;646 node->m_prev = nullptr; 657 647 node->m_next = m_head; 658 648 … … 687 677 return; 688 678 689 for (Node* node = m_head, *next = m_head->m_next; node; node = next, next = node ? node->m_next : 0)679 for (Node* node = m_head, *next = m_head->m_next; node; node = next, next = node ? node->m_next : nullptr) 690 680 delete node; 691 681 } … … 706 696 707 697 using WTF::ListHashSet; 708 709 #endif /* WTF_ListHashSet_h */
Note:
See TracChangeset
for help on using the changeset viewer.