mResources = resources; mCapacity = capacity;
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; }
ResourceSet::Add(nsIRDFResource* aResource){    NS_PRECONDITION(aResource != nsnull, "null ptr");    if (! aResource)        return NS_ERROR_NULL_POINTER;    if (Contains(aResource))        return NS_OK;    if (mCount >= mCapacity) {        PRInt32 capacity = mCapacity + 4;        nsIRDFResource** resources = new nsIRDFResource*[capacity];        if (! resources)            return NS_ERROR_OUT_OF_MEMORY;        for (PRInt32 i = mCount - 1; i >= 0; --i)            resources[i] = mResources[i];        delete[] mResources;        mResources = resources;        mCapacity = capacity;    }    mResources[mCount++] = aResource;    NS_ADDREF(aResource);    return NS_OK;}