Switch PluginSys off KTrie (bug 5884 part 3, r=ds).

This commit is contained in:
David Anderson
2013-08-25 11:59:46 -07:00
parent 544b6d94aa
commit 414440589e
4 changed files with 44 additions and 53 deletions
+2 -1
View File
@@ -61,7 +61,8 @@ class NameHashSet : public SystemAllocatorPolicy
// Default policy type: the two types are different. Use them directly.
template <typename KeyType, typename KeyPolicyType>
struct Policy {
struct Policy
{
typedef KeyType Payload;
static uint32_t hash(const CharsAndLength &key)
+8 -3
View File
@@ -120,7 +120,7 @@ public:
bool retrieve(const char *aKey, T *aResult = NULL)
{
CharsAndLength key(aKey);
typename Internal::Result r = internal_.find(key);
Result r = internal_.find(key);
if (!r.found())
return false;
if (aResult)
@@ -137,7 +137,7 @@ public:
bool contains(const char *aKey)
{
CharsAndLength key(aKey);
typename Internal::Result r = internal_.find(key);
Result r = internal_.find(key);
return r.found();
}
@@ -173,7 +173,7 @@ public:
bool remove(const char *aKey)
{
CharsAndLength key(aKey);
typename Internal::Result r = internal_.find(key);
Result r = internal_.find(key);
if (!r.found())
return false;
memory_used_ -= key.length() + 1;
@@ -181,6 +181,11 @@ public:
return true;
}
void remove(Result &r)
{
internal_.remove(r);
}
void clear()
{
internal_.clear();