Simplify endian checking