for (Assertion* as = GetForwardArcs(source); as != nsnull; as = as->mNext) { if ((property == as->mProperty) && (as->mTruthValue == tv)) { *target = as->mTarget; NS_ADDREF(as->mTarget);
Assertion *as = GetForwardArcs(source); if (as && as->mHashEntry) { PLDHashEntryHdr* hdr = PL_DHashTableOperate(as->u.hash.mPropertyHash, property, PL_DHASH_LOOKUP); Assertion* val = PL_DHASH_ENTRY_IS_BUSY(hdr) ? NS_REINTERPRET_CAST(Entry*, hdr)->mAssertions : nsnull; while (val) { if (tv == val->u.as.mTruthValue) { *target = val->u.as.mTarget; NS_IF_ADDREF(*target); return NS_OK; } val = val->mNext; } } else for (; as != nsnull; as = as->mNext) { if ((property == as->u.as.mProperty) && (tv == (as->u.as.mTruthValue))) { *target = as->u.as.mTarget; NS_ADDREF(*target);
InMemoryDataSource::GetTarget(nsIRDFResource* source,                              nsIRDFResource* property,                              PRBool tv,                              nsIRDFNode** target){    NS_PRECONDITION(source != nsnull, "null ptr");    if (! source)        return NS_ERROR_NULL_POINTER;    NS_PRECONDITION(property != nsnull, "null ptr");    if (! property)        return NS_ERROR_NULL_POINTER;    NS_PRECONDITION(target != nsnull, "null ptr");    if (! target)        return NS_ERROR_NULL_POINTER;    NS_AUTOLOCK(mLock);    for (Assertion* as = GetForwardArcs(source); as != nsnull; as = as->mNext) {        if ((property == as->mProperty) && (as->mTruthValue == tv)) {            *target = as->mTarget;            NS_ADDREF(as->mTarget);            return NS_OK;        }    }    // If we get here, then there was no target with for the specified    // property & truth value.    *target = nsnull;    return NS_RDF_NO_VALUE;}