From 94b941ee95a294228516097c269e27dfa41593ab Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 13 Jan 2020 09:10:13 -0800 Subject: Provide Record enumerator on View that disposes fetched Records --- src/WixToolset.Core.WindowsInstaller/Validator.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Validator.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/Validator.cs b/src/WixToolset.Core.WindowsInstaller/Validator.cs index 1c9cdc2f..72b09ebc 100644 --- a/src/WixToolset.Core.WindowsInstaller/Validator.cs +++ b/src/WixToolset.Core.WindowsInstaller/Validator.cs @@ -201,21 +201,13 @@ namespace WixToolset.Core.WindowsInstaller List actions = new List(); using (View view = database.OpenExecuteView("SELECT `Action` FROM `_ICESequence` ORDER BY `Sequence`")) { - while (true) + foreach (Record record in view.Records) { - using (Record record = view.Fetch()) - { - if (null == record) - { - break; - } + string action = record.GetString(1); - string action = record.GetString(1); - - if ((this.SuppressedICEs == null || !this.SuppressedICEs.Contains(action)) && (this.ICEs == null || this.ICEs.Contains(action))) - { - actions.Add(action); - } + if ((this.SuppressedICEs == null || !this.SuppressedICEs.Contains(action)) && (this.ICEs == null || this.ICEs.Contains(action))) + { + actions.Add(action); } } } -- cgit v1.2.3-55-g6feb