From 9cca339473d77c7036035f949239f5231c325968 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 26 Mar 2021 12:59:03 -0700 Subject: Integrate the IntermediateSection and IntermediateSymbol mutable changes --- .../Bind/AttachPatchTransformsCommand.cs | 27 ++++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs index 6d802d98..5f8df92c 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs @@ -241,23 +241,20 @@ namespace WixToolset.Core.WindowsInstaller.Bind foreach (var section in this.Intermediate.Sections) { - for (var i = section.Symbols.Count - 1; i >= 0; i--) + // Remove all summary information from the symbols and remember those that + // are not calculated or reserved. + foreach (var patchSummaryInfo in section.Symbols.OfType().ToList()) { - if (section.Symbols[i] is SummaryInformationSymbol patchSummaryInfo) + section.RemoveSymbol(patchSummaryInfo); + + if (patchSummaryInfo.PropertyId != SummaryInformationType.PatchProductCodes && + patchSummaryInfo.PropertyId != SummaryInformationType.PatchCode && + patchSummaryInfo.PropertyId != SummaryInformationType.PatchInstallerRequirement && + patchSummaryInfo.PropertyId != SummaryInformationType.Reserved11 && + patchSummaryInfo.PropertyId != SummaryInformationType.Reserved14 && + patchSummaryInfo.PropertyId != SummaryInformationType.Reserved16) { - // Remove all summary information from the symbols and remember those that - // are not calculated or reserved. - section.Symbols.RemoveAt(i); - - if (patchSummaryInfo.PropertyId != SummaryInformationType.PatchProductCodes && - patchSummaryInfo.PropertyId != SummaryInformationType.PatchCode && - patchSummaryInfo.PropertyId != SummaryInformationType.PatchInstallerRequirement && - patchSummaryInfo.PropertyId != SummaryInformationType.Reserved11 && - patchSummaryInfo.PropertyId != SummaryInformationType.Reserved14 && - patchSummaryInfo.PropertyId != SummaryInformationType.Reserved16) - { - result.Add(patchSummaryInfo.PropertyId, patchSummaryInfo); - } + result.Add(patchSummaryInfo.PropertyId, patchSummaryInfo); } } } -- cgit v1.2.3-55-g6feb