3 ms·
There's no performance penalty here. The only difference is that you're on the safe side if you don't dereference before the null check. Whether discussed case
by DominikD 11y ago
There's no performance penalty here. The only difference is that you're on the safe side if you don't dereference before the null check. Whether discussed case is UB or not, compilers I've tried (MSVC 2013, GCC 4.9.something) produce the same code in both cases.