[Path] remove superfluous nullptr checks
This commit is contained in:
@@ -46,9 +46,9 @@ PathSim::PathSim()
|
||||
|
||||
PathSim::~PathSim()
|
||||
{
|
||||
if (m_stock != nullptr)
|
||||
if (m_stock)
|
||||
delete m_stock;
|
||||
if (m_tool != nullptr)
|
||||
if (m_tool)
|
||||
delete m_tool;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ Base::Placement * PathSim::ApplyCommand(Base::Placement * pos, Command * cmd)
|
||||
Point3D fromPos(*pos);
|
||||
Point3D toPos(*pos);
|
||||
toPos.UpdateCmd(*cmd);
|
||||
if (m_tool != nullptr)
|
||||
if (m_tool)
|
||||
{
|
||||
if (cmd->Name == "G0" || cmd->Name == "G1")
|
||||
{
|
||||
|
||||
@@ -87,7 +87,7 @@ PyObject* PathSimPy::GetResultMesh(PyObject * args)
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
cStock *stock = getPathSimPtr()->m_stock;
|
||||
if (stock == nullptr)
|
||||
if (!stock)
|
||||
{
|
||||
PyErr_SetString(PyExc_RuntimeError, "Simulation has stock object");
|
||||
return nullptr;
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
|
||||
~Array2D()
|
||||
{
|
||||
if (data != nullptr)
|
||||
if (data)
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user