diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2017-04-14 12:18:40 +0900 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-04-15 23:05:19 +0200 |
commit | 4e29d2258c88f6127c2dac2ff7e755b063a76aa7 (patch) | |
tree | e1e5918f2df52c3f6ccda97c5fb1e97688b61b2a /sc | |
parent | 15c9f281a8f03c8030f1f364b82710676cea2c33 (diff) |
sc: Skip redundant check of emptiness
Change-Id: I65f87b03588f6542cfd5597e753c1a161e1ccfce
Reviewed-on: https://gerrit.libreoffice.org/36544
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr3.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 8502f1e76fa7..5bd341edd4ca 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -3286,7 +3286,7 @@ void ScInterpreter::ScSkewp() double ScInterpreter::GetMedian( vector<double> & rArray ) { size_t nSize = rArray.size(); - if (rArray.empty() || nSize == 0 || nGlobalError != FormulaError::NONE) + if (nSize == 0 || nGlobalError != FormulaError::NONE) { SetError( FormulaError::NoValue); return 0.0; @@ -3386,7 +3386,7 @@ void ScInterpreter::ScPercentile( bool bInclusive ) } vector<double> aArray; GetNumberSequenceArray( 1, aArray, false ); - if ( aArray.empty() || aArray.size() == 0 || nGlobalError != FormulaError::NONE ) + if ( aArray.empty() || nGlobalError != FormulaError::NONE ) { SetError( FormulaError::NoValue ); return; @@ -3409,7 +3409,7 @@ void ScInterpreter::ScQuartile( bool bInclusive ) } vector<double> aArray; GetNumberSequenceArray( 1, aArray, false ); - if ( aArray.empty() || aArray.size() == 0 || nGlobalError != FormulaError::NONE ) + if ( aArray.empty() || nGlobalError != FormulaError::NONE ) { SetError( FormulaError::NoValue ); return; @@ -3428,7 +3428,7 @@ void ScInterpreter::ScModalValue() vector<double> aSortArray; GetSortArray( nParamCount, aSortArray, nullptr, false, false ); SCSIZE nSize = aSortArray.size(); - if (aSortArray.empty() || nSize == 0 || nGlobalError != FormulaError::NONE) + if (nSize == 0 || nGlobalError != FormulaError::NONE) PushNoValue(); else { @@ -3483,7 +3483,7 @@ void ScInterpreter::CalculateSmallLarge(bool bSmall) * we may or will need a real sorted array again, see #i32345. */ GetNumberSequenceArray(1, aSortArray, false ); SCSIZE nSize = aSortArray.size(); - if (aSortArray.empty() || nSize == 0 || nGlobalError != FormulaError::NONE || nSize < k) + if (nSize == 0 || nGlobalError != FormulaError::NONE || nSize < k) PushNoValue(); else { @@ -3519,7 +3519,7 @@ void ScInterpreter::ScPercentrank( bool bInclusive ) vector<double> aSortArray; GetSortArray( 1, aSortArray, nullptr, false, false ); SCSIZE nSize = aSortArray.size(); - if ( aSortArray.empty() || nSize == 0 || nGlobalError != FormulaError::NONE ) + if ( nSize == 0 || nGlobalError != FormulaError::NONE ) PushNoValue(); else { @@ -3612,7 +3612,7 @@ void ScInterpreter::ScTrimMean() vector<double> aSortArray; GetSortArray( 1, aSortArray, nullptr, false, false ); SCSIZE nSize = aSortArray.size(); - if (aSortArray.empty() || nSize == 0 || nGlobalError != FormulaError::NONE) + if (nSize == 0 || nGlobalError != FormulaError::NONE) PushNoValue(); else { @@ -3857,7 +3857,7 @@ void ScInterpreter::ScRank( bool bAverage ) GetSortArray( 1, aSortArray, nullptr, false, false ); double fVal = GetDouble(); SCSIZE nSize = aSortArray.size(); - if ( aSortArray.empty() || nSize == 0 || nGlobalError != FormulaError::NONE ) + if ( nSize == 0 || nGlobalError != FormulaError::NONE ) PushNoValue(); else { |