When making sure h is C-contiguous for Cython, don't copy unless necessary.