Add readability-simplify-boolean-expr

* Add readability-simplify-boolean-expr
* Fixes based on review
This commit is contained in:
Magne Sjaastad
2023-06-26 13:12:41 +02:00
committed by GitHub
parent 34d83efaed
commit 59ca0b943c
116 changed files with 179 additions and 635 deletions

View File

@@ -121,7 +121,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int p
for ( int elmIdx = 0; elmIdx < femPart->elementCount(); ++elmIdx )
{
RigElementType elmType = femPart->elementType( elmIdx );
if ( !( elmType == HEX8 || elmType == HEX8P ) ) continue;
if ( elmType != HEX8 && elmType != HEX8P ) continue;
bool porRegion = false;
for ( int elmLocalNodeIdx = 0; elmLocalNodeIdx < 8; ++elmLocalNodeIdx )

View File

@@ -133,7 +133,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorStressGradients::calculate(
const int* cornerIndices = femPart->connectivities( elmIdx );
RigElementType elmType = femPart->elementType( elmIdx );
if ( !( elmType == HEX8P || elmType == HEX8 ) ) continue;
if ( elmType != HEX8P && elmType != HEX8 ) continue;
// Find the corner coordinates for element
std::array<cvf::Vec3d, 8> hexCorners;

View File

@@ -122,7 +122,7 @@ RigFemPartResultsCollection::RigFemPartResultsCollection( RifGeoMechReaderInterf
{
auto stepNameComplete = stepName;
if ( !( RiaRegressionTestRunner::instance()->isRunningRegressionTests() && m_readerInterface->frameTimes( stepIdx ).size() == 1 ) )
if ( !RiaRegressionTestRunner::instance()->isRunningRegressionTests() || m_readerInterface->frameTimes( stepIdx ).size() != 1 )
{
// Do not add postfix for time steps with a single frame to ensure identical generated snapshot
// name used by regression tests

View File

@@ -139,13 +139,8 @@ public:
bool operator==( const RigFemResultAddress& other ) const
{
if ( resultPosType != other.resultPosType || fieldName != other.fieldName || componentName != other.componentName ||
timeLapseBaseStepIdx != other.timeLapseBaseStepIdx || normalizedByHydrostaticPressure != other.normalizedByHydrostaticPressure )
{
return false;
}
return true;
return resultPosType == other.resultPosType && fieldName == other.fieldName && componentName == other.componentName &&
timeLapseBaseStepIdx == other.timeLapseBaseStepIdx && normalizedByHydrostaticPressure == other.normalizedByHydrostaticPressure;
}
private:

View File

@@ -94,11 +94,7 @@ bool RigGeoMechCaseData::open( std::string* errorMessage )
m_readerInterface = new RifOdbReader;
#endif
if ( m_readerInterface.notNull() && m_readerInterface->openFile( m_geoMechCaseFileName, errorMessage ) )
{
return true;
}
return false;
return m_readerInterface.notNull() && m_readerInterface->openFile( m_geoMechCaseFileName, errorMessage );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -81,7 +81,7 @@ ref<DrawableGeo> RivFemPartGeometryGenerator::generateSurface( const std::vector
//--------------------------------------------------------------------------------------------------
ref<DrawableGeo> RivFemPartGeometryGenerator::createMeshDrawable()
{
if ( !( m_quadVertices.notNull() && m_quadVertices->size() != 0 ) ) return nullptr;
if ( !m_quadVertices.notNull() || m_quadVertices->size() == 0 ) return nullptr;
ref<DrawableGeo> geo = new DrawableGeo;
geo->setVertexArray( m_quadVertices.p() );
@@ -100,7 +100,7 @@ ref<DrawableGeo> RivFemPartGeometryGenerator::createMeshDrawable()
//--------------------------------------------------------------------------------------------------
ref<DrawableGeo> RivFemPartGeometryGenerator::createOutlineMeshDrawable( double creaseAngle )
{
if ( !( m_quadVertices.notNull() && m_quadVertices->size() != 0 ) ) return nullptr;
if ( !m_quadVertices.notNull() || m_quadVertices->size() == 0 ) return nullptr;
cvf::OutlineEdgeExtractor ee( creaseAngle, *m_quadVertices );
@@ -289,7 +289,7 @@ cvf::ref<cvf::DrawableGeo> RivFemPartGeometryGenerator::createMeshDrawableFromSi
quadVertices->assign( vertices );
}
if ( !( quadVertices.notNull() && quadVertices->size() != 0 ) ) return nullptr;
if ( !quadVertices.notNull() || quadVertices->size() == 0 ) return nullptr;
ref<DrawableGeo> geo = new DrawableGeo;
geo->setVertexArray( quadVertices.p() );