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

@@ -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();
}

View File

@@ -29,7 +29,7 @@ CAF_CMD_SOURCE_INIT( RicHoloLensCreateDummyFiledBackedSessionFeature, "RicHoloLe
//--------------------------------------------------------------------------------------------------
bool RicHoloLensCreateDummyFiledBackedSessionFeature::isCommandEnabled()
{
return RicHoloLensSessionManager::instance()->session() ? false : true;
return RicHoloLensSessionManager::instance()->session() == nullptr;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -36,7 +36,7 @@ CAF_CMD_SOURCE_INIT( RicHoloLensCreateSessionFeature, "RicHoloLensCreateSessionF
//--------------------------------------------------------------------------------------------------
bool RicHoloLensCreateSessionFeature::isCommandEnabled()
{
return RicHoloLensSessionManager::instance()->session() ? false : true;
return RicHoloLensSessionManager::instance()->session() == nullptr;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -34,7 +34,7 @@ CAF_CMD_SOURCE_INIT( RicHoloLensTerminateSessionFeature, "RicHoloLensTerminateSe
//--------------------------------------------------------------------------------------------------
bool RicHoloLensTerminateSessionFeature::isCommandEnabled()
{
return RicHoloLensSessionManager::instance()->session() ? true : false;
return RicHoloLensSessionManager::instance()->session() != nullptr;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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 );
}
//--------------------------------------------------------------------------------------------------