Changeset 11561 in webkit for trunk/JavaScriptCore/kxmlcore/HashMap.h
- Timestamp:
- Dec 13, 2005, 3:06:10 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kxmlcore/HashMap.h
r10653 r11561 55 55 bool isEmpty() const; 56 56 57 // iterators iterate over pairs of keys and values 57 58 iterator begin(); 58 59 iterator end(); … … 66 67 67 68 // replaces value but not key if key is already present 69 // return value is a pair of the iterator to the key location, 70 // and a boolean that's true if a new value was actually added 68 71 std::pair<iterator, bool> set(const KeyType &key, const MappedType &mapped); 72 73 // does nothing if key is already present 74 // return value is a pair of the iterator to the key location, 75 // and a boolean that's true if a new value was actually added 76 std::pair<iterator, bool> add(const KeyType &key, const MappedType &mapped); 69 77 70 78 void remove(const KeyType& key); … … 140 148 { 141 149 pair<iterator, bool> result = m_impl.insert(ValueType(key, mapped)); 142 // the insert call above insertwon't change anything if the key is150 // the insert call above won't change anything if the key is 143 151 // already there; in that case, make sure to set the value. 144 152 if (!result.second) … … 148 156 149 157 template<typename Key, typename Mapped, typename HashFunctions, typename KeyTraits, typename MappedTraits> 158 std::pair<typename HashMap<Key, Mapped, HashFunctions, KeyTraits, MappedTraits>::iterator, bool> HashMap<Key, Mapped, HashFunctions, KeyTraits, MappedTraits>::add(const KeyType &key, const MappedType &mapped) 159 { 160 return m_impl.insert(ValueType(key, mapped)); 161 } 162 163 template<typename Key, typename Mapped, typename HashFunctions, typename KeyTraits, typename MappedTraits> 150 164 inline Mapped HashMap<Key, Mapped, HashFunctions, KeyTraits, MappedTraits>::get(const KeyType &key) const 151 165 {
Note:
See TracChangeset
for help on using the changeset viewer.