Review suggestion: just return if x or y is null.

Thanks to Yury Delendik for pointing out this simpler approach to the
problem.
Lint fix: use === instead of == to compare with null.