Avoid copying in ReadSectionHeaders (#894)
authorNext Turn <45985406+NextTurn@users.noreply.github.com>
Fri, 27 Dec 2019 18:43:47 +0000 (02:43 +0800)
committerJan Kotas <jkotas@microsoft.com>
Fri, 27 Dec 2019 18:43:47 +0000 (10:43 -0800)
src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEHeaders.cs

index 989bafb..3fcfc8b 100644 (file)
@@ -306,7 +306,7 @@ namespace System.Reflection.PortableExecutable
                 builder.Add(new SectionHeader(ref reader));
             }
 
-            return builder.ToImmutable();
+            return builder.MoveToImmutable();
         }
 
         /// <summary>