[Mesh] remove superfluous nullptr checks
This commit is contained in:
@@ -730,7 +730,7 @@ void MeshFacetGrid::Validate (const MeshKernel &rclMesh)
|
||||
|
||||
void MeshFacetGrid::Validate ()
|
||||
{
|
||||
if (_pclMesh == nullptr)
|
||||
if (!_pclMesh)
|
||||
return;
|
||||
|
||||
if (_pclMesh->CountFacets() != _ulCtElements)
|
||||
@@ -1072,7 +1072,7 @@ void MeshPointGrid::Validate (const MeshKernel &rclMesh)
|
||||
|
||||
void MeshPointGrid::Validate ()
|
||||
{
|
||||
if (_pclMesh == nullptr)
|
||||
if (!_pclMesh)
|
||||
return;
|
||||
|
||||
if (_pclMesh->CountPoints() != _ulCtElements)
|
||||
|
||||
@@ -262,8 +262,8 @@ bool MeshInput::LoadSTL (std::istream &rstrIn)
|
||||
boost::algorithm::to_upper(szBuf);
|
||||
|
||||
try {
|
||||
if ((strstr(szBuf, "SOLID") == nullptr) && (strstr(szBuf, "FACET") == nullptr) && (strstr(szBuf, "NORMAL") == nullptr) &&
|
||||
(strstr(szBuf, "VERTEX") == nullptr) && (strstr(szBuf, "ENDFACET") == nullptr) && (strstr(szBuf, "ENDLOOP") == nullptr)) {
|
||||
if (!strstr(szBuf, "SOLID") && !strstr(szBuf, "FACET") && !strstr(szBuf, "NORMAL") &&
|
||||
!strstr(szBuf, "VERTEX") && !strstr(szBuf, "ENDFACET") && !strstr(szBuf, "ENDLOOP")) {
|
||||
// probably binary STL
|
||||
buf->pubseekoff(0, std::ios::beg, std::ios::in);
|
||||
return LoadBinarySTL(rstrIn);
|
||||
|
||||
@@ -72,7 +72,7 @@ App::DocumentObjectExecReturn *SetOperations::execute()
|
||||
Mesh::Feature *mesh1 = dynamic_cast<Mesh::Feature*>(Source1.getValue());
|
||||
Mesh::Feature *mesh2 = dynamic_cast<Mesh::Feature*>(Source2.getValue());
|
||||
|
||||
if ((mesh1 != nullptr) && (mesh2 != nullptr)) {
|
||||
if (mesh1 && mesh2) {
|
||||
const MeshObject& meshKernel1 = mesh1->Mesh.getValue();
|
||||
const MeshObject& meshKernel2 = mesh2->Mesh.getValue();
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ bool DelTriangle<Real>::IsInsertionComponent (int i, DelTriangle* pkAdj,
|
||||
{
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
if (A[j] != nullptr && A[j] != pkAdj)
|
||||
if (A[j] && A[j] != pkAdj)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -632,7 +632,7 @@ const char* System::GetPath (const char* acDirectory, const char* acFilename)
|
||||
//----------------------------------------------------------------------------
|
||||
void System::Initialize ()
|
||||
{
|
||||
assert(ms_pkDirectories == nullptr);
|
||||
assert(!ms_pkDirectories);
|
||||
ms_pkDirectories = WM4_NEW std::vector<std::string>;
|
||||
|
||||
const char* acWm4Path = GetEnv("WM4_PATH");
|
||||
@@ -839,7 +839,7 @@ const char* System::GetEnv (const char* acEnvVarName)
|
||||
getenv_s(&uiRequiredSize,ms_acEnvVar,SYSTEM_MAX_ENVVAR,acEnvVarName);
|
||||
#else
|
||||
char* acEnvVar = getenv(acEnvVarName);
|
||||
if (acEnvVar == nullptr)
|
||||
if (!acEnvVar)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user