diff --git a/Common/Hardware/Common.Hardware.SIRT/SerialDataExtensions.cs b/Common/Hardware/Common.Hardware.SIRT/SerialDataExtensions.cs index 0a95d106..67a39cdc 100644 --- a/Common/Hardware/Common.Hardware.SIRT/SerialDataExtensions.cs +++ b/Common/Hardware/Common.Hardware.SIRT/SerialDataExtensions.cs @@ -441,18 +441,16 @@ public static ushort ToUIint16LEFromBits(this byte[] bits) { - const int size = 16; - if (bits is null) { - bits = new byte[size]; + bits = new byte[UInt16Size]; } - Array.Resize(ref bits, size); + Array.Resize(ref bits, UInt16Size); ushort value = 0; - for (var i = 0; i < size; i++) + for (var i = 0; i < UInt16Size; i++) { value ^= (ushort)(bits[i] << i); }