mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add readability-simplify-boolean-expr
* Add readability-simplify-boolean-expr * Fixes based on review
This commit is contained in:
@@ -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 )
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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() );
|
||||
|
||||
Reference in New Issue
Block a user