Remove unnecessary null pointer checks
Note that "not needed" is not the same as "wrong" or "useless". In some cases where the argument is 0 most of the time, the explicit check is faster than a function call (actually 2 since delete usually calls free, and none of this gets inlined). However, I agree that the default should be a plain, unprotected call to delete, and the very few places where it is deemed profitable to keep the null pointer check need a comment explaining it.
- Which distribution would you expect (or actually observe) for the passing of null pointers?
- Should pointers for valid objects be usually handled more often?
How do you think about to use a development tool like “clang-tidy” for corresponding source code adjustments?
If nobody is working on this issue i would like to work on it. Please assign it to me.
For the range tree it is not worth the effort. There is much more to do, namely a singleton for the anchor of the recursive structure.
Sir I am a beginner and this would be my first issue so can you please suugest something according to my skill set. Thanks
I am beginner an this would be first issue.can you suggest something according to my skill set