summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-25 16:31:42 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-25 16:52:30 +0100
commitc59a5b81e9521a92587e701bcad82bf643b00493 (patch)
treeb08b97f67c53e6ec1b3cae06cd19ebac2ca15cea /sc
parent75299cd119dcb3121540471354d2b33af7f6684d (diff)
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I8d98aa7dd77fbd79611b8a4aba77e8c378fd1cae Reviewed-on: https://gerrit.libreoffice.org/63981 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/global2.cxx2
-rw-r--r--sc/source/core/tool/interpr2.cxx2
-rw-r--r--sc/source/core/tool/interpr3.cxx6
-rw-r--r--sc/source/core/tool/interpr5.cxx10
4 files changed, 10 insertions, 10 deletions
diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx
index 6ae017c103e9..04687ebf7ab0 100644
--- a/sc/source/core/data/global2.cxx
+++ b/sc/source/core/data/global2.cxx
@@ -229,7 +229,7 @@ bool ScSolveParam::operator==( const ScSolveParam& r ) const
bEqual = true;
else if ( !pStrTargetVal || !r.pStrTargetVal )
bEqual = false;
- else if ( pStrTargetVal && r.pStrTargetVal )
+ else
bEqual = ( *pStrTargetVal == *(r.pStrTargetVal) );
}
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index c151000f34e1..aeba2c660b5d 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -627,7 +627,7 @@ void ScInterpreter::ScWorkday_MS()
while ( nRef >= 0 && nSortArray.at( nRef ) > nDate )
nRef--;
- if ( !( nRef >= 0 && nSortArray.at( nRef ) == nDate ) || nRef < 0 )
+ if (nRef < 0 || nSortArray.at(nRef) != nDate)
nDays++;
}
}
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 56078ea0b915..ac980b7257da 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -218,7 +218,7 @@ double ScInterpreter::gauss(double x)
0.00000000011301172, 0.00000000000511243, -0.00000000000021218 };
nVal = taylor(t0, 11, (xAbs * xAbs)) * xAbs;
}
- else if ((xShort >= 1) && (xShort <= 2))
+ else if (xShort <= 2)
{
static const double t2[] =
{ 0.47724986805182079, 0.05399096651318805, -0.05399096651318805,
@@ -231,7 +231,7 @@ double ScInterpreter::gauss(double x)
-0.00000000000172127, -0.00000000000008634, 0.00000000000007894 };
nVal = taylor(t2, 23, (xAbs - 2.0));
}
- else if ((xShort >= 3) && (xShort <= 4))
+ else if (xShort <= 4)
{
static const double t4[] =
{ 0.49996832875816688, 0.00013383022576489, -0.00026766045152977,
@@ -4083,7 +4083,7 @@ void ScInterpreter::ScRank( bool bAverage )
double fFirstPos = -1.0;
bool bFinished = false;
SCSIZE i;
- for ( i = 0; i < nSize && !bFinished && nGlobalError == FormulaError::NONE; i++ )
+ for (i = 0; i < nSize && !bFinished; i++)
{
if ( aSortArray[ i ] == fVal )
{
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 2ab00919d6fa..c898d7a95057 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -740,7 +740,7 @@ static int lcl_LUP_decompose( ScMatrix* mA, const SCSIZE n,
bool bSingular=false;
for (SCSIZE i=0; i<n && !bSingular; i++)
- bSingular = bSingular || ((mA->GetDouble(i,i))==0.0);
+ bSingular = (mA->GetDouble(i,i)) == 0.0;
if (bSingular)
nSign = 0;
@@ -2520,7 +2520,7 @@ void ScInterpreter::CalculateRGPRKP(bool _bRKP)
// that they aren't zero.
bool bIsSingular=false;
for (SCSIZE row=0; row < K && !bIsSingular; row++)
- bIsSingular = bIsSingular || aVecR[row]==0.0;
+ bIsSingular = aVecR[row] == 0.0;
if (bIsSingular)
{
PushNoValue();
@@ -2677,7 +2677,7 @@ void ScInterpreter::CalculateRGPRKP(bool _bRKP)
// that they aren't zero.
bool bIsSingular=false;
for (SCSIZE row=0; row < K && !bIsSingular; row++)
- bIsSingular = bIsSingular || aVecR[row]==0.0;
+ bIsSingular = aVecR[row] == 0.0;
if (bIsSingular)
{
PushNoValue();
@@ -3018,7 +3018,7 @@ void ScInterpreter::CalculateTrendGrowth(bool _bGrowth)
// that they aren't zero.
bool bIsSingular=false;
for (SCSIZE row=0; row < K && !bIsSingular; row++)
- bIsSingular = bIsSingular || aVecR[row]==0.0;
+ bIsSingular = aVecR[row] == 0.0;
if (bIsSingular)
{
PushNoValue();
@@ -3077,7 +3077,7 @@ void ScInterpreter::CalculateTrendGrowth(bool _bGrowth)
// that they aren't zero.
bool bIsSingular=false;
for (SCSIZE row=0; row < K && !bIsSingular; row++)
- bIsSingular = bIsSingular || aVecR[row]==0.0;
+ bIsSingular = aVecR[row] == 0.0;
if (bIsSingular)
{
PushNoValue();