Changeset 19302 in webkit for trunk/JavaScriptCore/wtf/HashTable.h
- Timestamp:
- Jan 31, 2007, 5:43:13 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/HashTable.h
r17127 r19302 292 292 template<typename T, typename Extra, typename HashTranslator> pair<iterator, bool> add(const T& key, const Extra&); 293 293 294 iterator find(const KeyType&); 295 const_iterator find(const KeyType&) const; 296 bool contains(const KeyType&) const; 294 iterator find(const KeyType& key) { return find<KeyType, IdentityTranslatorType>(key); } 295 const_iterator find(const KeyType& key) const { return find<KeyType, IdentityTranslatorType>(key); } 296 bool contains(const KeyType& key) const { return contains<KeyType, IdentityTranslatorType>(key); } 297 298 template <typename T, typename HashTranslator> iterator find(const T&); 299 template <typename T, typename HashTranslator> const_iterator find(const T&) const; 300 template <typename T, typename HashTranslator> bool contains(const T&) const; 297 301 298 302 void remove(const KeyType&); … … 468 472 469 473 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 470 typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::iterator HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::find(const Key& key) 474 template <typename T, typename HashTranslator> 475 typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::iterator HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::find(const T& key) 471 476 { 472 477 if (!m_table) 473 478 return end(); 474 479 475 LookupType result = lookup (key);480 LookupType result = lookup<T, HashTranslator>(key).first; 476 481 if (!result.second) 477 482 return end(); … … 480 485 481 486 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 482 typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::const_iterator HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::find(const Key& key) const 487 template <typename T, typename HashTranslator> 488 typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::const_iterator HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::find(const T& key) const 483 489 { 484 490 if (!m_table) 485 491 return end(); 486 492 487 LookupType result = const_cast<HashTable *>(this)->lookup (key);493 LookupType result = const_cast<HashTable *>(this)->lookup<T, HashTranslator>(key).first; 488 494 if (!result.second) 489 495 return end(); … … 492 498 493 499 template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> 494 bool HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::contains(const KeyType& key) const 500 template <typename T, typename HashTranslator> 501 bool HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::contains(const T& key) const 495 502 { 496 503 if (!m_table) 497 504 return false; 498 505 499 return const_cast<HashTable *>(this)->lookup (key).second;506 return const_cast<HashTable *>(this)->lookup<T, HashTranslator>(key).first.second; 500 507 } 501 508
Note:
See TracChangeset
for help on using the changeset viewer.