mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-08-24 19:36:05 +08:00
Coding - Remove redundant null checks before deallocation (#1077)
In C++, delete/delete[] on nullptr and free(NULL) are guaranteed no-ops. This removes redundant null-check guards before these calls across 39 files, reducing code noise without behavioral change. Also simplifies map value cleanup in BRepClass3d_SolidExplorer by using iterator reference instead of redundant hash lookups.
This commit is contained in:
@@ -608,11 +608,8 @@ void Image_AlienPixMap::Clear()
|
||||
myPalette = NULL;
|
||||
}
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
if (myLibImage != NULL)
|
||||
{
|
||||
free((void*)myLibImage);
|
||||
myLibImage = NULL;
|
||||
}
|
||||
free((void*)myLibImage);
|
||||
myLibImage = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user