diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-21 15:53:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-22 12:42:07 +0200 |
commit | 4347b5975283ca1a591b6c3d4559ed360e187022 (patch) | |
tree | d607931cc2143988fe344f32b8f311bcf4f3ef51 /sc | |
parent | b55fda6d9eb83460382c0da74eb5cd3a3d03cd7f (diff) |
pvs-studio: V728 An excessive check can be simplified
for...
"The '(A && !B) || (!A && B)' expression is equivalent to the 'bool(A) != bool(B)' expression"
subcases, where the args are already bool
Change-Id: Ica8b5c4974c513f7f7ad8acf17ca931e85ebc8af
Reviewed-on: https://gerrit.libreoffice.org/62146
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 8 | ||||
-rw-r--r-- | sc/source/core/tool/address.cxx | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index d6bfc428ccb8..0f0f5e57f134 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1441,10 +1441,7 @@ public: { pCurDVR = static_cast<const formula::DoubleVectorRefToken*>(tmpCur); - if (! - ((!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) - || (pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed())) - ) + if (pCurDVR->IsStartFixed() != pCurDVR->IsEndFixed()) throw Unhandled(__FILE__, __LINE__); } } @@ -2182,8 +2179,7 @@ static DynamicKernelArgument* VectorRefFactory( const ScCalcConfig& config, cons // Window being too small to justify a parallel reduction if (pDVR->GetRefRowSize() < REDUCE_THRESHOLD) return new DynamicKernelSlidingArgument<Base>(config, s, ft, pCodeGen, index); - if ((pDVR->IsStartFixed() && pDVR->IsEndFixed()) || - (!pDVR->IsStartFixed() && !pDVR->IsEndFixed())) + if (pDVR->IsStartFixed() == pDVR->IsEndFixed()) return new ParallelReductionVectorRef<Base>(config, s, ft, pCodeGen, index); else // Other cases are not supported as well return new DynamicKernelSlidingArgument<Base>(config, s, ft, pCodeGen, index); diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 650d3553612c..31a9c816fd5d 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -961,7 +961,7 @@ static bool isValidSingleton( ScRefFlags nFlags, ScRefFlags nFlags2 ) { bool bCols = (nFlags & ScRefFlags::COL_VALID) && ((nFlags & ScRefFlags::COL2_VALID) || (nFlags2 & ScRefFlags::COL_VALID)); bool bRows = (nFlags & ScRefFlags::ROW_VALID) && ((nFlags & ScRefFlags::ROW2_VALID) || (nFlags2 & ScRefFlags::ROW_VALID)); - return (bCols && !bRows) || (!bCols && bRows); + return bCols != bRows; } static ScRefFlags lcl_ScRange_Parse_XL_A1( ScRange& r, |