mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -04:00
Minor cleanups
This commit is contained in:
parent
a2e1098224
commit
51af543fd7
@ -270,25 +270,43 @@ QVariant QgsExpressionNodeBinaryOperator::compareNonNullValues( QgsExpression *p
|
|||||||
// All other variants always return false.
|
// All other variants always return false.
|
||||||
|
|
||||||
// Note: Boolean logical operators behave the same in C++ and SQL.
|
// Note: Boolean logical operators behave the same in C++ and SQL.
|
||||||
switch ( mOp )
|
const bool vLBool = vL.toBool();
|
||||||
|
const bool vRBool = vR.toBool();
|
||||||
|
switch ( op )
|
||||||
{
|
{
|
||||||
case boEQ:
|
case boEQ:
|
||||||
return vL.toBool() == vR.toBool() ? TVL_True : TVL_False;
|
return vLBool == vRBool ? TVL_True : TVL_False;
|
||||||
case boNE:
|
case boNE:
|
||||||
return vL.toBool() != vR.toBool() ? TVL_True : TVL_False;
|
return vLBool != vRBool ? TVL_True : TVL_False;
|
||||||
case boLT:
|
case boLT:
|
||||||
return vL.toBool() < vR.toBool() ? TVL_True : TVL_False;
|
return vLBool < vRBool ? TVL_True : TVL_False;
|
||||||
case boLE:
|
case boLE:
|
||||||
return vL.toBool() <= vR.toBool() ? TVL_True : TVL_False;
|
return vLBool <= vRBool ? TVL_True : TVL_False;
|
||||||
case boGT:
|
case boGT:
|
||||||
return vL.toBool() > vR.toBool() ? TVL_True : TVL_False;
|
return vLBool > vRBool ? TVL_True : TVL_False;
|
||||||
case boGE:
|
case boGE:
|
||||||
return vL.toBool() >= vR.toBool() ? TVL_True : TVL_False;
|
return vLBool >= vRBool ? TVL_True : TVL_False;
|
||||||
default:
|
case boOr:
|
||||||
// Can't happen [cosmic ray hits excepted]
|
case boAnd:
|
||||||
Q_ASSERT( false );
|
case boRegexp:
|
||||||
return TVL_Unknown;
|
case boLike:
|
||||||
|
case boNotLike:
|
||||||
|
case boILike:
|
||||||
|
case boNotILike:
|
||||||
|
case boIs:
|
||||||
|
case boIsNot:
|
||||||
|
case boPlus:
|
||||||
|
case boMinus:
|
||||||
|
case boMul:
|
||||||
|
case boDiv:
|
||||||
|
case boIntDiv:
|
||||||
|
case boMod:
|
||||||
|
case boPow:
|
||||||
|
case boConcat:
|
||||||
|
// should not happen
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
return TVL_Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
// warning - QgsExpression::isIntervalSafe is VERY expensive and should not be used here
|
// warning - QgsExpression::isIntervalSafe is VERY expensive and should not be used here
|
||||||
|
Loading…
x
Reference in New Issue
Block a user