Changeset 12321 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jan 23, 2006, 4:56:32 PM (19 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r12319 r12321 1 2006-01-23 Maciej Stachowiak <[email protected]> 2 3 Rubber stamped by Tim Hatcher. 4 5 - renamed inert() operation on HashSet, HashCountedSet and HashTable to add() 6 for consistency with HashMap 7 8 * kjs/array_object.cpp: 9 (ArrayProtoFunc::callAsFunction): 10 * kjs/collector.cpp: 11 (KJS::Collector::protect): 12 * kjs/identifier.cpp: 13 (KJS::Identifier::add): 14 * kxmlcore/HashCountedSet.h: 15 (KXMLCore::::add): 16 * kxmlcore/HashMap.h: 17 (KXMLCore::::inlineAdd): 18 * kxmlcore/HashSet.h: 19 (KXMLCore::::add): 20 * kxmlcore/HashTable.h: 21 (KXMLCore::HashTable::add): 22 (KXMLCore::::add): 23 (KXMLCore::::HashTable): 24 1 25 2006-01-23 Justin Garcia <[email protected]> 2 26 -
trunk/JavaScriptCore/kjs/array_object.cpp
r12317 r12321 481 481 UString str = ""; 482 482 483 visitedElems. insert(thisObj);483 visitedElems.add(thisObj); 484 484 if (id == Join && !args[0]->isUndefined()) 485 485 separator = args[0]->toString(exec); -
trunk/JavaScriptCore/kjs/collector.cpp
r12317 r12321 412 412 return; 413 413 414 protectedValues(). insert(k->downcast());414 protectedValues().add(k->downcast()); 415 415 } 416 416 -
trunk/JavaScriptCore/kjs/identifier.cpp
r12317 r12321 139 139 return &UString::Rep::empty; 140 140 141 return *identifierTable(). insert<const char *, CStringTranslator>(c).first;141 return *identifierTable().add<const char *, CStringTranslator>(c).first; 142 142 } 143 143 … … 180 180 181 181 UCharBuffer buf = {s, length}; 182 return *identifierTable(). insert<UCharBuffer, UCharBufferTranslator>(buf).first;182 return *identifierTable().add<UCharBuffer, UCharBufferTranslator>(buf).first; 183 183 } 184 184 … … 191 191 return &UString::Rep::empty; 192 192 193 UString::Rep *result = *identifierTable(). insert(r).first;193 UString::Rep *result = *identifierTable().add(r).first; 194 194 if (result == r) 195 195 r->isIdentifier = true; -
trunk/JavaScriptCore/kxmlcore/HashCountedSet.h
r12301 r12321 56 56 57 57 // increases the count if an equal value is already present 58 // returnsvalue is a pair of an interator to the new value's location,59 // and a bool that is true if an actual new insertion was done60 std::pair<iterator, bool> insert(const ValueType &value);58 // the return value is a pair of an interator to the new value's location, 59 // and a bool that is true if an new entry was added 60 std::pair<iterator, bool> add(const ValueType &value); 61 61 62 62 // reduces the count of the value, and removes it if count … … 138 138 139 139 template<typename Value, typename HashFunctions, typename Traits> 140 inline std::pair<typename HashCountedSet<Value, HashFunctions, Traits>::iterator, bool> HashCountedSet<Value, HashFunctions, Traits>:: insert(const ValueType &value)140 inline std::pair<typename HashCountedSet<Value, HashFunctions, Traits>::iterator, bool> HashCountedSet<Value, HashFunctions, Traits>::add(const ValueType &value) 141 141 { 142 142 pair<iterator, bool> result = m_impl.add(value, 0); -
trunk/JavaScriptCore/kxmlcore/HashMap.h
r12301 r12321 174 174 pair<typename HashMap<Key, Mapped, HashFunctions, KeyTraits, MappedTraits>::iterator, bool> HashMap<Key, Mapped, HashFunctions, KeyTraits, MappedTraits>::inlineAdd(const KeyType &key, const MappedType &mapped) 175 175 { 176 return m_impl.template insert<KeyType, MappedType, TranslatorType>(key, mapped);176 return m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped); 177 177 } 178 178 -
trunk/JavaScriptCore/kxmlcore/HashSet.h
r12301 r12321 80 80 bool contains(const ValueType& value) const; 81 81 82 std::pair<iterator, bool> insert(const ValueType &value); 83 84 // a special version of insert() that finds the object by hashing and comparing 82 // the return value is a pair of an interator to the new value's location, 83 // and a bool that is true if an new entry was added 84 std::pair<iterator, bool> add(const ValueType &value); 85 86 // a special version of add() that finds the object by hashing and comparing 85 87 // with some other type, to avoid the cost of type conversion if the object is already 86 88 // in the table. HashTranslator should have the following methods: … … 89 91 // static translate(ValueType&, const T&, unsigned hashCode); 90 92 template<typename T, typename HashTranslator> 91 std::pair<iterator, bool> insert(const T& value);93 std::pair<iterator, bool> add(const T& value); 92 94 93 95 void remove(const ValueType& value); … … 160 162 161 163 template<typename Value, typename HashFunctions, typename Traits> 162 std::pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool> HashSet<Value, HashFunctions, Traits>:: insert(const ValueType &value)163 { 164 return m_impl. insert(value);164 std::pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool> HashSet<Value, HashFunctions, Traits>::add(const ValueType &value) 165 { 166 return m_impl.add(value); 165 167 } 166 168 167 169 template<typename Value, typename HashFunctions, typename Traits> 168 170 template<typename T, typename HashSetTranslator> 169 std::pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool> HashSet<Value, HashFunctions, Traits>:: insert(const T& value)170 { 171 return m_impl.template insert<T, T, HashSetTranslatorAdapter<ValueType, T, HashSetTranslator> >(value, value);171 std::pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool> HashSet<Value, HashFunctions, Traits>::add(const T& value) 172 { 173 return m_impl.template add<T, T, HashSetTranslatorAdapter<ValueType, T, HashSetTranslator> >(value, value); 172 174 } 173 175 -
trunk/JavaScriptCore/kxmlcore/HashTable.h
r12301 r12321 285 285 int capacity() const { return m_tableSize; } 286 286 287 pair<iterator, bool> insert(const ValueType& value) { return insert<KeyType, ValueType, IdentityTranslatorType>(ExtractKey(value), value); }288 289 // A special version of insert() that finds the object by hashing and comparing287 pair<iterator, bool> add(const ValueType& value) { return add<KeyType, ValueType, IdentityTranslatorType>(ExtractKey(value), value); } 288 289 // A special version of add() that finds the object by hashing and comparing 290 290 // with some other type, to avoid the cost of type conversion if the object is already 291 291 // in the table. 292 template<typename T, typename Extra, typename HashTranslator> pair<iterator, bool> insert(const T& key, const Extra&);292 template<typename T, typename Extra, typename HashTranslator> pair<iterator, bool> add(const T& key, const Extra&); 293 293 294 294 iterator find(const KeyType&); … … 416 416 template<typename Key, typename Value, const Key& ExtractKey(const Value&), typename HashFunctions, typename Traits, typename KeyTraits> 417 417 template<typename T, typename Extra, typename HashTranslator> 418 inline pair<typename HashTable<Key, Value, ExtractKey, HashFunctions, Traits, KeyTraits>::iterator, bool> HashTable<Key, Value, ExtractKey, HashFunctions, Traits, KeyTraits>:: insert(const T& key, const Extra &extra)418 inline pair<typename HashTable<Key, Value, ExtractKey, HashFunctions, Traits, KeyTraits>::iterator, bool> HashTable<Key, Value, ExtractKey, HashFunctions, Traits, KeyTraits>::add(const T& key, const Extra &extra) 419 419 { 420 420 invalidateIterators(); … … 632 632 #endif 633 633 { 634 // Copy the hash table the dumb way, by inserting each element into the new table.634 // Copy the hash table the dumb way, by adding each element to the new table. 635 635 // It might be more efficient to copy the table slots, but it's not clear that efficiency is needed. 636 636 const_iterator end = other.end(); 637 637 for (const_iterator it = other.begin(); it != end; ++it) 638 insert(*it);638 add(*it); 639 639 } 640 640
Note:
See TracChangeset
for help on using the changeset viewer.