mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-12 16:21:13 +00:00
Remove unneeded if when deleting NULL / 0 / nullptr
C++ standard dictates that NULL / 0 / nullptr is a valid argument for delete which then simply has no effect: "The value of the first argument supplied to a deallocation function may be a null pointer value; if so, and if the deallocation function is one supplied in the standard library, the call has no effect." I therefore think in these particular case it's safe to remove the ifs.
This commit is contained in:
parent
d1cf852c98
commit
2a72d58766
|
@ -231,8 +231,5 @@ bool FairMQPollerNN::CheckOutput(const string channelKey, const int index)
|
||||||
|
|
||||||
FairMQPollerNN::~FairMQPollerNN()
|
FairMQPollerNN::~FairMQPollerNN()
|
||||||
{
|
{
|
||||||
if (items != NULL)
|
delete[] items;
|
||||||
{
|
|
||||||
delete[] items;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,8 +234,5 @@ bool FairMQPollerSHM::CheckOutput(const string channelKey, const int index)
|
||||||
|
|
||||||
FairMQPollerSHM::~FairMQPollerSHM()
|
FairMQPollerSHM::~FairMQPollerSHM()
|
||||||
{
|
{
|
||||||
if (items != NULL)
|
delete[] items;
|
||||||
{
|
|
||||||
delete[] items;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,8 +234,5 @@ bool FairMQPollerZMQ::CheckOutput(const string channelKey, const int index)
|
||||||
|
|
||||||
FairMQPollerZMQ::~FairMQPollerZMQ()
|
FairMQPollerZMQ::~FairMQPollerZMQ()
|
||||||
{
|
{
|
||||||
if (items != NULL)
|
delete[] items;
|
||||||
{
|
|
||||||
delete[] items;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user