Switch HalfLife2 off KTrie (bug 5884 part 7, r=ds).
This commit is contained in:
@@ -98,6 +98,7 @@ class HashMap : public AllocPolicy
|
||||
|
||||
typedef typename Internal::Result Result;
|
||||
typedef typename Internal::Insert Insert;
|
||||
typedef typename Internal::iterator iterator;
|
||||
|
||||
template <typename Lookup>
|
||||
Result find(const Lookup &key) {
|
||||
@@ -131,6 +132,10 @@ class HashMap : public AllocPolicy
|
||||
return table_.add(i);
|
||||
}
|
||||
|
||||
iterator iter() {
|
||||
return iterator(&table_);
|
||||
}
|
||||
|
||||
void clear() {
|
||||
table_.clear();
|
||||
}
|
||||
@@ -143,6 +148,17 @@ class HashMap : public AllocPolicy
|
||||
Internal table_;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct PointerPolicy
|
||||
{
|
||||
static inline uint32_t hash(T *p) {
|
||||
return HashPointer(p);
|
||||
}
|
||||
static inline bool matches(T *p1, T *p2) {
|
||||
return p1 == p2;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // _include_amtl_hashmap_h_
|
||||
|
||||
@@ -472,7 +472,10 @@ class HashTable : public AllocPolicy
|
||||
table_->removeEntry(*i_);
|
||||
}
|
||||
|
||||
const Payload &operator *() const {
|
||||
Payload *operator ->() const {
|
||||
return &i_->payload();
|
||||
}
|
||||
Payload &operator *() const {
|
||||
return i_->payload();
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ public:
|
||||
|
||||
typedef typename Internal::Result Result;
|
||||
typedef typename Internal::Insert Insert;
|
||||
typedef typename Internal::iterator iterator;
|
||||
|
||||
bool retrieve(const char *aKey, T *value)
|
||||
{
|
||||
@@ -147,6 +148,11 @@ public:
|
||||
table_.clear();
|
||||
}
|
||||
|
||||
iterator iter()
|
||||
{
|
||||
return iterator(&table_);
|
||||
}
|
||||
|
||||
private:
|
||||
Internal table_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user