Optimized nullable comparison.