Small performance enhancement for checksum generation.

When any is set as a valid checksum, skip generation of the checksum as it is not
needed.