private static void CopyInputBytes16(out ByteUnionBase16 unionBytes, byte[] inputBytes) // TODO: Span<byte>? { unchecked { unionBytes.Byte1Value = inputBytes[1]; // Read highest value first to help compiler optimize correctly (don't need to check size twice) unionBytes.Byte0Value = inputBytes[0]; } }
private static void CopyInputBytes16(out ByteUnionBase16 unionBytes, byte[] inputBytes, int offset) { // TODO: properly help compiler avoid checking if 'offset' is negative? unchecked { unionBytes.Byte1Value = inputBytes[offset + 1]; // Read highest value first to help compiler optimize correctly (don't need to check size twice) unionBytes.Byte0Value = inputBytes[offset + 0]; } }