PLHashEntry** hep = PL_HashTableRawLookup(mLiterals, (*mLiterals->keyHash)(value), value);
if (! hdr) return NS_ERROR_OUT_OF_MEMORY;
RDFServiceImpl::RegisterLiteral(nsIRDFLiteral* aLiteral, PRBool aReplace){    NS_PRECONDITION(aLiteral != nsnull, "null ptr");    if (! aLiteral)        return NS_ERROR_NULL_POINTER;    nsresult rv;#ifdef REUSE_LITERAL_VALUE_AS_KEY    const PRUnichar* value;    rv = aLiteral->GetValueConst(&value);#else    nsXPIDLString value;    rv = aLiteral->GetValue(getter_Copies(value));#endif    NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get literal's value");    if (NS_FAILED(rv)) return rv;    PLHashEntry** hep = PL_HashTableRawLookup(mLiterals, (*mLiterals->keyHash)(value), value);    if (*hep) {        if (! aReplace) {            NS_WARNING("literal already registered and replace not specified");            return NS_ERROR_FAILURE;        }        // N.B., we do _not_ release the original literal because we        // only ever held a weak reference to it. We simply replace        // it.        PR_LOG(gLog, PR_LOG_DEBUG,               ("rdfserv   replace-literal [%p] <-- [%p] %s",                (*hep)->value, aLiteral, (const PRUnichar*) value));#ifdef REUSE_LITERAL_VALUE_AS_KEY        (*hep)->key   = value;#endif        (*hep)->value = aLiteral;    }    else {#ifdef REUSE_LITERAL_VALUE_AS_KEY        PL_HashTableAdd(mLiterals, value, aLiteral);#else        const PRUnichar* key = value.get() ? nsCRT::strdup(value.get()) : 0;        if (! key)            return NS_ERROR_OUT_OF_MEMORY;        PL_HashTableAdd(mLiterals, key, aLiteral);#endif        PR_LOG(gLog, PR_LOG_DEBUG,               ("rdfserv   register-literal [%p] %s",                aLiteral, (const PRUnichar*) value));        // N.B., we only hold a weak reference to the literal: that        // way, the literal can be destroyed when the last refcount        // goes away. The single addref that the CreateLiteral() call        // made will be owned by the callee.    }    return NS_OK;}