Minor code clean up
Rob Mensching committed
Nov 17, 2022 at 14:11 UTC
307e3f1bb587b93ad386bbfd9b2d4603a72d80c4
2 files changed
+6
-10
src/wix/WixToolset.Core/Compiler.cs
+4
-7
@@ -3981,7 +3981,6 @@ namespace WixToolset.Core
3981
var depth = CompilerConstants.IntegerNotSet;
3982
string path = null;
3983
var assignToProperty = false;
3984
- string signature = null;
3984
3985
foreach (var attrib in node.Attributes())
3986
{
@@ -4017,7 +4016,7 @@ namespace WixToolset.Core
4016
id = this.Core.CreateIdentifier("dir", path, depth.ToString());
4017
}
4018
4020
- signature = id.Id;
4019
+ var signature = id.Id;
4020
4021
var oneChild = false;
4022
var hasFileSearch = false;
@@ -4132,7 +4131,6 @@ namespace WixToolset.Core
4131
Identifier id = null;
4132
Identifier parent = null;
4133
string path = null;
4135
- string signature = null;
4134
4135
foreach (var attrib in node.Attributes())
4136
{
@@ -4177,7 +4175,7 @@ namespace WixToolset.Core
4175
id = this.Core.CreateIdentifier("dsr", parentSignature, path);
4176
}
4177
4180
- signature = id.Id;
4178
+ var signature = id.Id;
4179
4180
var oneChild = false;
4181
foreach (var child in node.Elements())
@@ -4258,7 +4256,6 @@ namespace WixToolset.Core
4256
var typicalDefault = FeatureTypicalDefault.Install;
4257
var disallowAbsent = false;
4258
var disallowAdvertise = false;
4261
- var display = 0;
4259
4260
foreach (var attrib in node.Attributes())
4261
{
@@ -4410,6 +4407,7 @@ namespace WixToolset.Core
4407
}
4408
}
4409
4410
+ int display;
4411
switch (displayValue)
4412
{
4413
case "collapse":
@@ -6067,7 +6065,6 @@ namespace WixToolset.Core
6065
string name = null;
6066
string section = null;
6067
string shortName = null;
6070
- string signature = null;
6068
var type = 1; // default is file
6069
6070
foreach (var attrib in node.Attributes())
@@ -6145,7 +6142,7 @@ namespace WixToolset.Core
6142
id = this.Core.CreateIdentifier("ini", name, section, key, field.ToString(), type.ToString());
6143
}
6144
6148
- signature = id.Id;
6145
+ var signature = id.Id;
6146
6147
var oneChild = false;
6148
foreach (var child in node.Elements())
src/wix/WixToolset.Core/Compiler_Package.cs
+2
-3
@@ -539,8 +539,7 @@ namespace WixToolset.Core
539
switch (child.Name.LocalName)
540
{
541
case "ODBCDataSource":
542
- string ignoredKeyPath = null;
543
- this.ParseODBCDataSource(child, componentId, name, out ignoredKeyPath);
542
+ this.ParseODBCDataSource(child, componentId, name, out _);
543
break;
544
case "Property":
545
this.ParseODBCProperty(child, id.Id, SymbolDefinitionType.ODBCAttribute);
@@ -1009,7 +1008,7 @@ namespace WixToolset.Core
1008
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
1009
var bits = new BitArray(32);
1010
string domain = null;
1012
- string[] specialPermissions = null;
1011
+ string[] specialPermissions;
1012
string user = null;
1013
1014
switch (tableName)