fix(s7): use ArrayCount!.Value in DecodeArrayBlock (review I-1 clarity)
This commit is contained in:
@@ -530,7 +530,7 @@ public sealed class S7Driver
|
|||||||
/// <returns>An element-typed CLR array boxed as <see cref="object"/>.</returns>
|
/// <returns>An element-typed CLR array boxed as <see cref="object"/>.</returns>
|
||||||
internal static object DecodeArrayBlock(S7TagDefinition tag, S7ParsedAddress addr, byte[] block)
|
internal static object DecodeArrayBlock(S7TagDefinition tag, S7ParsedAddress addr, byte[] block)
|
||||||
{
|
{
|
||||||
var count = tag.ArrayCount is > 1 ? tag.ArrayCount.Value : 1;
|
var count = tag.ArrayCount!.Value;
|
||||||
var elementBytes = ElementByteSize(addr.Size);
|
var elementBytes = ElementByteSize(addr.Size);
|
||||||
|
|
||||||
switch (tag.DataType, addr.Size)
|
switch (tag.DataType, addr.Size)
|
||||||
|
|||||||
Reference in New Issue
Block a user