if (0 == modified.GetCount())
if (modified.IsEmpty()) continue;  Value memberValue; match->mAssignments.GetAssignmentFor(rule->GetMemberVariable(), &memberValue);  nsIRDFResource* resource = VALUE_TO_IRDFRESOURCE(memberValue); NS_ASSERTION(resource != nsnull, "no content"); if (! resource)
nsXULTemplateBuilder::SynchronizeAll(nsIRDFResource* aSource,                                     nsIRDFResource* aProperty,                                     nsIRDFNode* aOldTarget,                                     nsIRDFNode* aNewTarget){    // Update each match that contains <aSource, aProperty, aOldTarget>.    // Get all the matches whose assignments are currently supported    // by aSource and aProperty: we'll need to recompute them.    const nsTemplateMatchRefSet* matches =        mConflictSet.GetMatchesWithBindingDependency(aSource);    if (! matches || matches->Empty())        return NS_OK;    // Since we'll actually be manipulating the match set as we    // iterate through it, we need to copy it into our own private    // area before performing the iteration.    nsTemplateMatchRefSet copy = *matches;    nsTemplateMatchRefSet::ConstIterator last = copy.Last();    for (nsTemplateMatchRefSet::ConstIterator match = copy.First(); match != last; ++match) {        const nsTemplateRule* rule = match->mRule;        // Recompute the assignments. This will replace aOldTarget with        // aNewTarget, which will disrupt the match set.        VariableSet modified;        rule->RecomputeBindings(mConflictSet, match.operator->(),                                aSource, aProperty, aOldTarget, aNewTarget,                                modified);        // If nothing changed, then continue on to the next match.        if (0 == modified.GetCount())            continue;#ifdef PR_LOGGING        PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,               ("xultemplate[%p] match %p, %d modified binding(s)",                this, match.operator->(), modified.GetCount()));        for (PRInt32 i = 0; i < modified.GetCount(); ++i) {            PRInt32 var = modified.GetVariableAt(i);            Value val;            match->GetAssignmentFor(mConflictSet, var, &val);            nsCAutoString str;            val.ToCString(str);            PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,                   ("xultemplate[%p]   %d <= %s", this, var, str.get()));        }#endif        SynchronizeMatch(match.operator->(), modified);    }    return NS_OK;}