ETEngine icon indicating copy to clipboard operation
ETEngine copied to clipboard

Remove unnecessary null pointer checks

Open elfring opened this issue 4 years ago • 2 comments

i use this

template <typename TElement>
inline void SafeDelete(TElement*& elementPointer)
{
    if (elementPointer)
    {
        delete elementPointer;
        elementPointer = nullptr;
    }
}

codenamecpp avatar May 27 '20 14:05 codenamecpp

@codenamecpp: I find that your example for a function template contains an unnecessary null pointer check.

elfring avatar May 27 '20 15:05 elfring