3 ms·
If, after inlining and so on, the compiler can prove that the condition implies the non-null/Some case, then the check can be optimised away. If it can't, then
by twic 9y ago
If, after inlining and so on, the compiler can prove that the condition implies the non-null/Some case, then the check can be optimised away.
If it can't, then the version without the check is potentially unsafe, and the check is not unnecessary.