3 ms·
> 1. What's the proper way to do a NULL check? In the first example, they show how a NULL check could be optimized away, but I didn't see where they explained h
by lmm 10y ago
> 1. What's the proper way to do a NULL check? In the first example, they show how a NULL check could be optimized away, but I didn't see where they explained how to do it the right way. I might have just missed it though.
You need to not do * p at all if p is NULL (i.e. move the "int dead = * p" after the early return).