From 71ec7b39630de6be9b1e61fe911b67a87609c5ce Mon Sep 17 00:00:00 2001 From: Roman Ettlinger Date: Mon, 19 Oct 2026 16:54:22 +0200 Subject: [PATCH] BinaryDecoder: empty arrays as collection expressions Review feedback on #4849: return [] instead of Array.Empty(); for an array return type it is the same shared instance. Co-Authored-By: Claude Opus 5.5 --- src/Opc.Ua.Types/Encoders/BinaryDecoder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Opc.Ua.Types/Encoders/BinaryDecoder.cs b/src/Opc.Ua.Types/Encoders/BinaryDecoder.cs index 8d6dcc29d2..1a55015d86 100644 --- a/src/Opc.Ua.Types/Encoders/BinaryDecoder.cs +++ b/src/Opc.Ua.Types/Encoders/BinaryDecoder.cs @@ -2435,7 +2435,7 @@ namespace Opc.Ua // an empty array is immutable: all share one instance. if (length == 0) { - return Array.Empty(); + return []; } int capacity = GetInitialArrayCapacity(length); @@ -2534,7 +2534,7 @@ namespace Opc.Ua { if (length == 0) { - return Array.Empty(); + return []; } // The caller verified the length against the remaining bytes. If