Use negated pattern.

This commit is contained in:
2022-11-14 01:20:28 +00:00
parent a17a6e1788
commit c2878f9a42

View File

@@ -245,8 +245,8 @@ public static class Marshal
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static T MarshalStructure<T>(byte[] bytes) where T : struct
{
if(!(typeof(T).GetCustomAttribute(typeof(MarshallingPropertiesAttribute)) is MarshallingPropertiesAttribute
properties))
if(typeof(T).GetCustomAttribute(typeof(MarshallingPropertiesAttribute)) is not MarshallingPropertiesAttribute
properties)
return ByteArrayToStructureLittleEndian<T>(bytes);
return properties.Endian switch