ConflictSet::Add(Match* aMatch, PRBool* aDidAddKey) {    *aDidAddKey = PR_FALSE;   { ClusterKey key(aMatch->mInstantiation, aMatch->mRule);  PLHashNumber hash = key.Hash(); PLHashEntry** hep = PL_HashTableRawLookup(mClusters, hash, &key);  MatchSet* set;  if (hep && *hep) { set = NS_STATIC_CAST(MatchSet*, (*hep)->value); } else { PLHashEntry* he = PL_HashTableRawAdd(mClusters, hep, hash, &key, nsnull); if (! he) return NS_ERROR_OUT_OF_MEMORY;  ClusterEntry* entry = NS_REINTERPRET_CAST(ClusterEntry*, he);      entry->mHashEntry.key   = &entry->mKey; entry->mHashEntry.value = &entry->mMatchSet;  set = &entry->mMatchSet; }  if (! set->Contains(*aMatch)) { set->Add(mPool, aMatch); *aDidAddKey = PR_TRUE; } }    { MemoryElementSet::ConstIterator last = aMatch->mInstantiation.mSupport.Last(); for (MemoryElementSet::ConstIterator element = aMatch->mInstantiation.mSupport.First(); element != last; ++element) { PLHashNumber hash = element->Hash(); PLHashEntry** hep = PL_HashTableRawLookup(mSupport, hash, element.operator->());  MatchSet* set;  if (hep && *hep) { set = NS_STATIC_CAST(MatchSet*, (*hep)->value); } else { PLHashEntry* he = PL_HashTableRawAdd(mSupport, hep, hash, element.operator->(), nsnull);  SupportEntry* entry = NS_REINTERPRET_CAST(SupportEntry*, he); if (! entry) return NS_ERROR_OUT_OF_MEMORY;   entry->mHashEntry.key   = entry->mElement; entry->mHashEntry.value = &entry->mMatchSet;  set = &entry->mMatchSet; }  if (! set->Contains(*aMatch)) { set->Add(mPool, aMatch); } } }   ResourceSet::ConstIterator last = aMatch->mBindingDependencies.Last(); for (ResourceSet::ConstIterator dep = aMatch->mBindingDependencies.First(); dep != last; ++dep) AddBindingDependency(aMatch, *dep);  return NS_OK; }
Iterator Add(nsFixedSizeAllocator& aPool, Match* aMatch) { return Insert(aPool, Last(), aMatch); }
ConflictSet::Add(Match* aMatch, PRBool* aDidAddKey){    // Add a match to the conflict set. This involves adding it to    // the cluster table, the support table, and the binding table.    *aDidAddKey = PR_FALSE;    // add the match to a table indexed by instantiation key    {        ClusterKey key(aMatch->mInstantiation, aMatch->mRule);        PLHashNumber hash = key.Hash();        PLHashEntry** hep = PL_HashTableRawLookup(mClusters, hash, &key);        MatchSet* set;        if (hep && *hep) {            set = NS_STATIC_CAST(MatchSet*, (*hep)->value);        }        else {            PLHashEntry* he = PL_HashTableRawAdd(mClusters, hep, hash, &key, nsnull);            if (! he)                return NS_ERROR_OUT_OF_MEMORY;            ClusterEntry* entry = NS_REINTERPRET_CAST(ClusterEntry*, he);            // Fixup the key in the hashentry to point to the value            // that the specially-allocated entry contains (rather            // than the value on the stack). Do the same for its            // value.            entry->mHashEntry.key   = &entry->mKey;            entry->mHashEntry.value = &entry->mMatchSet;            set = &entry->mMatchSet;        }        if (! set->Contains(*aMatch)) {            set->Add(mPool, aMatch);            *aDidAddKey = PR_TRUE;        }    }    // Add the match to a table indexed by supporting MemoryElement    {        MemoryElementSet::ConstIterator last = aMatch->mInstantiation.mSupport.Last();        for (MemoryElementSet::ConstIterator element = aMatch->mInstantiation.mSupport.First(); element != last; ++element) {            PLHashNumber hash = element->Hash();            PLHashEntry** hep = PL_HashTableRawLookup(mSupport, hash, element.operator->());            MatchSet* set;            if (hep && *hep) {                set = NS_STATIC_CAST(MatchSet*, (*hep)->value);            }            else {                PLHashEntry* he = PL_HashTableRawAdd(mSupport, hep, hash, element.operator->(), nsnull);                SupportEntry* entry = NS_REINTERPRET_CAST(SupportEntry*, he);                if (! entry)                    return NS_ERROR_OUT_OF_MEMORY;                // Fixup the key and value.                entry->mHashEntry.key   = entry->mElement;                entry->mHashEntry.value = &entry->mMatchSet;                set = &entry->mMatchSet;            }            if (! set->Contains(*aMatch)) {                set->Add(mPool, aMatch);            }        }    }    // Add the match to a table indexed by bound MemoryElement    ResourceSet::ConstIterator last = aMatch->mBindingDependencies.Last();    for (ResourceSet::ConstIterator dep = aMatch->mBindingDependencies.First(); dep != last; ++dep)        AddBindingDependency(aMatch, *dep);    return NS_OK;}