Changeset 27710 in webkit for trunk/JavaScriptCore/wtf/HashTable.h
- Timestamp:
- Nov 11, 2007, 10:44:26 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/HashTable.h
r27359 r27710 322 322 void remove(const KeyType&); 323 323 void remove(iterator); 324 void removeWithoutEntryConsistencyCheck(iterator); 324 325 void clear(); 325 326 … … 329 330 330 331 ValueType* lookup(const Key& key) { return lookup<Key, IdentityTranslatorType>(key); } 332 333 #if CHECK_HASHTABLE_CONSISTENCY 334 void checkTableConsistency() const; 335 #else 336 static void checkTableConsistency() { } 337 #endif 331 338 332 339 private: … … 342 349 template<typename T, typename HashTranslator> LookupType lookupForWriting(const T&); 343 350 351 void removeAndInvalidateWithoutEntryConsistencyCheck(ValueType*); 352 void removeAndInvalidate(ValueType*); 344 353 void remove(ValueType*); 345 354 … … 365 374 366 375 #if CHECK_HASHTABLE_CONSISTENCY 367 void checkTableConsistency() const;368 376 void checkTableConsistencyExceptSize() const; 369 377 #else 370 static void checkTableConsistency() { }371 378 static void checkTableConsistencyExceptSize() { } 372 379 #endif … … 759 766 760 767 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 761 void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(ValueType* pos) 768 void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::removeAndInvalidateWithoutEntryConsistencyCheck(ValueType* pos) 769 { 770 invalidateIterators(); 771 remove(pos); 772 } 773 774 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 775 void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::removeAndInvalidate(ValueType* pos) 762 776 { 763 777 invalidateIterators(); 764 778 checkTableConsistency(); 765 779 remove(pos); 780 } 781 782 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 783 void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::remove(ValueType* pos) 784 { 766 785 #if DUMP_HASHTABLE_STATS 767 786 ++HashTableStats::numRemoves; … … 784 803 return; 785 804 786 remove(const_cast<ValueType*>(it.m_iterator.m_position)); 805 removeAndInvalidate(const_cast<ValueType*>(it.m_iterator.m_position)); 806 } 807 808 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 809 inline void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::removeWithoutEntryConsistencyCheck(iterator it) 810 { 811 if (it == end()) 812 return; 813 814 removeAndInvalidateWithoutEntryConsistencyCheck(const_cast<ValueType*>(it.m_iterator.m_position)); 787 815 } 788 816
Note:
See TracChangeset
for help on using the changeset viewer.