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:
@@ -137,12 +137,5 @@ bool RicHoloLensAutoExportToSharingServerFeature::isCommandChecked()
|
||||
bool RicHoloLensAutoExportToSharingServerFeature::isSessionValid() const
|
||||
{
|
||||
RicHoloLensSession* session = RicHoloLensSessionManager::instance()->session();
|
||||
if ( session && session->isSessionValid() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return session && session->isSessionValid();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ CAF_CMD_SOURCE_INIT( RicHoloLensCreateDummyFiledBackedSessionFeature, "RicHoloLe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicHoloLensCreateDummyFiledBackedSessionFeature::isCommandEnabled()
|
||||
{
|
||||
return RicHoloLensSessionManager::instance()->session() ? false : true;
|
||||
return RicHoloLensSessionManager::instance()->session() == nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -36,7 +36,7 @@ CAF_CMD_SOURCE_INIT( RicHoloLensCreateSessionFeature, "RicHoloLensCreateSessionF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicHoloLensCreateSessionFeature::isCommandEnabled()
|
||||
{
|
||||
return RicHoloLensSessionManager::instance()->session() ? false : true;
|
||||
return RicHoloLensSessionManager::instance()->session() == nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -35,14 +35,7 @@ CAF_CMD_SOURCE_INIT( RicHoloLensExportToSharingServerFeature, "RicHoloLensExport
|
||||
bool RicHoloLensExportToSharingServerFeature::isCommandEnabled()
|
||||
{
|
||||
RicHoloLensSession* session = RicHoloLensSessionManager::instance()->session();
|
||||
if ( session && session->isSessionValid() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return session && session->isSessionValid();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -34,7 +34,7 @@ CAF_CMD_SOURCE_INIT( RicHoloLensTerminateSessionFeature, "RicHoloLensTerminateSe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicHoloLensTerminateSessionFeature::isCommandEnabled()
|
||||
{
|
||||
return RicHoloLensSessionManager::instance()->session() ? true : false;
|
||||
return RicHoloLensSessionManager::instance()->session() != nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -70,14 +70,7 @@ VdeArrayDataPacket::VdeArrayDataPacket()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool VdeArrayDataPacket::isValid() const
|
||||
{
|
||||
if ( m_elementType != Unknown && m_packetBytes.size() >= VDE_HEADER_SIZE && m_arrayId >= 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return m_elementType != Unknown && m_packetBytes.size() >= VDE_HEADER_SIZE && m_arrayId >= 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -91,12 +91,7 @@ bool VdeFileExporter::exportViewContents( const RimGridView& view )
|
||||
VdePacketDirectory packetDirectory;
|
||||
extractor.extractViewContents( &modelMetaJsonStr, &allReferencedArrayIds, &packetDirectory );
|
||||
|
||||
if ( !exportToFile( modelMetaJsonStr, packetDirectory, allReferencedArrayIds ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return exportToFile( modelMetaJsonStr, packetDirectory, allReferencedArrayIds );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user