From 94023034dc9acbd5663dfac7cbeb54001838070b Mon Sep 17 00:00:00 2001 From: Stoyan Zlatev Date: Wed, 26 Feb 2025 08:00:15 +0100 Subject: [PATCH] just for sync --- .../Hardware/Common.Hardware.SIRT/SerialDataExtensions.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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); }