Bug 1163194 - Part 2: Wrap expensive calls in PR_LOG_TEST. r=froydnj

Check that logging is enabled before performing potentially expensive
operations.
This commit is contained in:
Eric Rahm 2015-05-11 13:58:14 -07:00
parent c38c7c76ef
commit 1cee0023a8

View File

@ -1261,7 +1261,7 @@ nsXULTemplateQueryProcessorRDF::CompileQueryChild(nsIAtom* aTag,
TestNode* aParentNode,
TestNode** aResult)
{
nsresult rv;
nsresult rv = NS_OK;
if (aTag == nsGkAtoms::triple) {
rv = CompileTripleCondition(aQuery, aCondition, aParentNode, aResult);
@ -1269,7 +1269,7 @@ nsXULTemplateQueryProcessorRDF::CompileQueryChild(nsIAtom* aTag,
else if (aTag == nsGkAtoms::member) {
rv = CompileMemberCondition(aQuery, aCondition, aParentNode, aResult);
}
else {
else if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_ALWAYS)) {
nsAutoString tagstr;
aTag->ToString(tagstr);
@ -1278,8 +1278,6 @@ nsXULTemplateQueryProcessorRDF::CompileQueryChild(nsIAtom* aTag,
PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
("xultemplate[%p] unrecognized condition test <%s>",
this, tagstrC.get()));
rv = NS_OK;
}
return rv;