From 725fdf269b8ad9bb1ef3e5011c1cd5feb23e99a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-R=C3=A9my=20Bancel?= Date: Mon, 19 Nov 2018 23:03:41 -0800 Subject: [PATCH] Construct the return value List with the proper capacity --- src/prod/src/managed/Api/src/System/Fabric/OperationData.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prod/src/managed/Api/src/System/Fabric/OperationData.cs b/src/prod/src/managed/Api/src/System/Fabric/OperationData.cs index 41f7ac5b2..44b673362 100644 --- a/src/prod/src/managed/Api/src/System/Fabric/OperationData.cs +++ b/src/prod/src/managed/Api/src/System/Fabric/OperationData.cs @@ -106,7 +106,7 @@ internal static OperationData CreateFromNative(uint count, IntPtr buffer) private static unsafe IList> CreateFromNativeInternal(uint count, IntPtr buffer) { - List> returnValue = new List>(); + List> returnValue = new List>(count); for (int i = 0; i < count; i++) { @@ -117,4 +117,4 @@ private static unsafe IList> CreateFromNativeInternal(uint co return returnValue.AsReadOnly(); } } -} \ No newline at end of file +}