mirror of
https://github.com/aaru-dps/Aaru.Helpers.git
synced 2025-12-16 19:24:35 +00:00
Use negated pattern.
This commit is contained in:
@@ -245,8 +245,8 @@ public static class Marshal
|
|||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static T MarshalStructure<T>(byte[] bytes) where T : struct
|
public static T MarshalStructure<T>(byte[] bytes) where T : struct
|
||||||
{
|
{
|
||||||
if(!(typeof(T).GetCustomAttribute(typeof(MarshallingPropertiesAttribute)) is MarshallingPropertiesAttribute
|
if(typeof(T).GetCustomAttribute(typeof(MarshallingPropertiesAttribute)) is not MarshallingPropertiesAttribute
|
||||||
properties))
|
properties)
|
||||||
return ByteArrayToStructureLittleEndian<T>(bytes);
|
return ByteArrayToStructureLittleEndian<T>(bytes);
|
||||||
|
|
||||||
return properties.Endian switch
|
return properties.Endian switch
|
||||||
|
|||||||
Reference in New Issue
Block a user