From 307e3f1bb587b93ad386bbfd9b2d4603a72d80c4 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 17 Nov 2022 14:11:08 -0800 Subject: Minor code clean up --- src/wix/WixToolset.Core/Compiler.cs | 11 ++++------- src/wix/WixToolset.Core/Compiler_Package.cs | 5 ++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/wix/WixToolset.Core/Compiler.cs b/src/wix/WixToolset.Core/Compiler.cs index bd10fc55..60d4f10c 100644 --- a/src/wix/WixToolset.Core/Compiler.cs +++ b/src/wix/WixToolset.Core/Compiler.cs @@ -3981,7 +3981,6 @@ namespace WixToolset.Core var depth = CompilerConstants.IntegerNotSet; string path = null; var assignToProperty = false; - string signature = null; foreach (var attrib in node.Attributes()) { @@ -4017,7 +4016,7 @@ namespace WixToolset.Core id = this.Core.CreateIdentifier("dir", path, depth.ToString()); } - signature = id.Id; + var signature = id.Id; var oneChild = false; var hasFileSearch = false; @@ -4132,7 +4131,6 @@ namespace WixToolset.Core Identifier id = null; Identifier parent = null; string path = null; - string signature = null; foreach (var attrib in node.Attributes()) { @@ -4177,7 +4175,7 @@ namespace WixToolset.Core id = this.Core.CreateIdentifier("dsr", parentSignature, path); } - signature = id.Id; + var signature = id.Id; var oneChild = false; foreach (var child in node.Elements()) @@ -4258,7 +4256,6 @@ namespace WixToolset.Core var typicalDefault = FeatureTypicalDefault.Install; var disallowAbsent = false; var disallowAdvertise = false; - var display = 0; foreach (var attrib in node.Attributes()) { @@ -4410,6 +4407,7 @@ namespace WixToolset.Core } } + int display; switch (displayValue) { case "collapse": @@ -6067,7 +6065,6 @@ namespace WixToolset.Core string name = null; string section = null; string shortName = null; - string signature = null; var type = 1; // default is file foreach (var attrib in node.Attributes()) @@ -6145,7 +6142,7 @@ namespace WixToolset.Core id = this.Core.CreateIdentifier("ini", name, section, key, field.ToString(), type.ToString()); } - signature = id.Id; + var signature = id.Id; var oneChild = false; foreach (var child in node.Elements()) diff --git a/src/wix/WixToolset.Core/Compiler_Package.cs b/src/wix/WixToolset.Core/Compiler_Package.cs index e1bfb595..3c9e6d6a 100644 --- a/src/wix/WixToolset.Core/Compiler_Package.cs +++ b/src/wix/WixToolset.Core/Compiler_Package.cs @@ -539,8 +539,7 @@ namespace WixToolset.Core switch (child.Name.LocalName) { case "ODBCDataSource": - string ignoredKeyPath = null; - this.ParseODBCDataSource(child, componentId, name, out ignoredKeyPath); + this.ParseODBCDataSource(child, componentId, name, out _); break; case "Property": this.ParseODBCProperty(child, id.Id, SymbolDefinitionType.ODBCAttribute); @@ -1009,7 +1008,7 @@ namespace WixToolset.Core var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); var bits = new BitArray(32); string domain = null; - string[] specialPermissions = null; + string[] specialPermissions; string user = null; switch (tableName) -- cgit v1.2.3-55-g6feb