Bug 517553: Remove '=='/'!=' 'PR_FALSE'/'PR_TRUE'
This commit is contained in:
@@ -266,7 +266,7 @@ CompositeEnumeratorImpl::HasMoreElements(PRBool* aResult)
|
||||
rv = result->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) &mResult);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (mAllowNegativeAssertions == PR_TRUE)
|
||||
if (mAllowNegativeAssertions)
|
||||
{
|
||||
// See if any previous data source negates this
|
||||
PRBool hasNegation = PR_FALSE;
|
||||
@@ -290,7 +290,7 @@ CompositeEnumeratorImpl::HasMoreElements(PRBool* aResult)
|
||||
}
|
||||
}
|
||||
|
||||
if (mCoalesceDuplicateArcs == PR_TRUE)
|
||||
if (mCoalesceDuplicateArcs)
|
||||
{
|
||||
// Now see if we've returned it once already.
|
||||
// XXX N.B. performance here...may want to hash if things get large?
|
||||
@@ -303,7 +303,7 @@ CompositeEnumeratorImpl::HasMoreElements(PRBool* aResult)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (alreadyReturned == PR_TRUE)
|
||||
if (alreadyReturned)
|
||||
{
|
||||
NS_RELEASE(mResult);
|
||||
continue;
|
||||
@@ -320,7 +320,7 @@ CompositeEnumeratorImpl::HasMoreElements(PRBool* aResult)
|
||||
// optional. This could get to be pretty expensive (this
|
||||
// implementation turns iteration into O(n^2)).
|
||||
|
||||
if (mCoalesceDuplicateArcs == PR_TRUE)
|
||||
if (mCoalesceDuplicateArcs)
|
||||
{
|
||||
mAlreadyReturned.AppendElement(mResult);
|
||||
}
|
||||
@@ -686,7 +686,7 @@ CompositeDataSourceImpl::GetSource(nsIRDFResource* property,
|
||||
PRBool tv,
|
||||
nsIRDFResource** source)
|
||||
{
|
||||
if ((mAllowNegativeAssertions == PR_FALSE) && (tv == PR_FALSE))
|
||||
if (!mAllowNegativeAssertions && !tv)
|
||||
return(NS_RDF_NO_VALUE);
|
||||
|
||||
PRInt32 count = mDataSources.Count();
|
||||
@@ -698,7 +698,7 @@ CompositeDataSourceImpl::GetSource(nsIRDFResource* property,
|
||||
if (rv == NS_RDF_NO_VALUE)
|
||||
continue;
|
||||
|
||||
if (mAllowNegativeAssertions == PR_FALSE) return(NS_OK);
|
||||
if (!mAllowNegativeAssertions) return(NS_OK);
|
||||
|
||||
// okay, found it. make sure we don't have the opposite
|
||||
// asserted in a more local data source
|
||||
@@ -729,7 +729,7 @@ CompositeDataSourceImpl::GetSources(nsIRDFResource* aProperty,
|
||||
if (! aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE))
|
||||
if (! mAllowNegativeAssertions && ! aTruthValue)
|
||||
return(NS_RDF_NO_VALUE);
|
||||
|
||||
*aResult = CompositeAssertionEnumeratorImpl::Create(mAllocator,
|
||||
@@ -763,7 +763,7 @@ CompositeDataSourceImpl::GetTarget(nsIRDFResource* aSource,
|
||||
if (! aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE))
|
||||
if (! mAllowNegativeAssertions && ! aTruthValue)
|
||||
return(NS_RDF_NO_VALUE);
|
||||
|
||||
PRInt32 count = mDataSources.Count();
|
||||
@@ -778,7 +778,7 @@ CompositeDataSourceImpl::GetTarget(nsIRDFResource* aSource,
|
||||
// okay, found it. make sure we don't have the opposite
|
||||
// asserted in an earlier data source
|
||||
|
||||
if (mAllowNegativeAssertions == PR_TRUE) {
|
||||
if (mAllowNegativeAssertions) {
|
||||
if (HasAssertionN(count-1, aSource, aProperty, *aResult, !aTruthValue)) {
|
||||
// whoops, it's been negated.
|
||||
NS_RELEASE(*aResult);
|
||||
@@ -835,7 +835,7 @@ CompositeDataSourceImpl::GetTargets(nsIRDFResource* aSource,
|
||||
if (! aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE))
|
||||
if (! mAllowNegativeAssertions && ! aTruthValue)
|
||||
return(NS_RDF_NO_VALUE);
|
||||
|
||||
*aResult =
|
||||
@@ -870,7 +870,7 @@ CompositeDataSourceImpl::Assert(nsIRDFResource* aSource,
|
||||
if (! aTarget)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE))
|
||||
if (! mAllowNegativeAssertions && ! aTruthValue)
|
||||
return(NS_RDF_ASSERTION_REJECTED);
|
||||
|
||||
nsresult rv;
|
||||
@@ -1066,7 +1066,7 @@ CompositeDataSourceImpl::HasAssertion(nsIRDFResource* aSource,
|
||||
if (! aResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if ((mAllowNegativeAssertions == PR_FALSE) && (aTruthValue == PR_FALSE))
|
||||
if (! mAllowNegativeAssertions && ! aTruthValue)
|
||||
{
|
||||
*aResult = PR_FALSE;
|
||||
return(NS_OK);
|
||||
@@ -1085,7 +1085,7 @@ CompositeDataSourceImpl::HasAssertion(nsIRDFResource* aSource,
|
||||
if (*aResult)
|
||||
return NS_OK;
|
||||
|
||||
if (mAllowNegativeAssertions == PR_TRUE)
|
||||
if (mAllowNegativeAssertions)
|
||||
{
|
||||
PRBool hasNegation;
|
||||
rv = datasource->HasAssertion(aSource, aProperty, aTarget, !aTruthValue, &hasNegation);
|
||||
@@ -1138,7 +1138,7 @@ CompositeDataSourceImpl::HasArcIn(nsIRDFNode *aNode, nsIRDFResource *aArc, PRBoo
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
rv = mDataSources[i]->HasArcIn(aNode, aArc, result);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*result == PR_TRUE)
|
||||
if (*result)
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_OK;
|
||||
@@ -1153,7 +1153,7 @@ CompositeDataSourceImpl::HasArcOut(nsIRDFResource *aSource, nsIRDFResource *aArc
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
rv = mDataSources[i]->HasArcOut(aSource, aArc, result);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*result == PR_TRUE)
|
||||
if (*result)
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_OK;
|
||||
@@ -1235,7 +1235,8 @@ CompositeDataSourceImpl::GetAllCmds(nsIRDFResource* source,
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
PRBool hasMore = PR_FALSE;
|
||||
while(NS_SUCCEEDED(rv = dsCmds->HasMoreElements(&hasMore)) && (hasMore == PR_TRUE))
|
||||
while(NS_SUCCEEDED(rv = dsCmds->HasMoreElements(&hasMore)) &&
|
||||
hasMore)
|
||||
{
|
||||
nsCOMPtr<nsISupports> item;
|
||||
if (NS_SUCCEEDED(rv = dsCmds->GetNext(getter_AddRefs(item))))
|
||||
@@ -1397,7 +1398,7 @@ CompositeDataSourceImpl::OnAssert(nsIRDFDataSource* aDataSource,
|
||||
// datasource that coughed up the assertion.
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (mAllowNegativeAssertions == PR_TRUE)
|
||||
if (mAllowNegativeAssertions)
|
||||
{
|
||||
PRBool hasAssertion;
|
||||
rv = HasAssertion(aSource, aProperty, aTarget, PR_TRUE, &hasAssertion);
|
||||
@@ -1428,7 +1429,7 @@ CompositeDataSourceImpl::OnUnassert(nsIRDFDataSource* aDataSource,
|
||||
// datasource that coughed up the assertion.
|
||||
nsresult rv;
|
||||
|
||||
if (mAllowNegativeAssertions == PR_TRUE)
|
||||
if (mAllowNegativeAssertions)
|
||||
{
|
||||
PRBool hasAssertion;
|
||||
rv = HasAssertion(aSource, aProperty, aTarget, PR_TRUE, &hasAssertion);
|
||||
|
||||
Reference in New Issue
Block a user