Use out var syntax
This commit is contained in:
@@ -62,8 +62,7 @@ namespace OpenRA.Mods.Common.FileFormats
|
||||
return null;
|
||||
var sectionName = m.Groups[1].Value.ToLowerInvariant();
|
||||
|
||||
IniSection ret;
|
||||
if (!sections.TryGetValue(sectionName, out ret))
|
||||
if (!sections.TryGetValue(sectionName, out var ret))
|
||||
sections.Add(sectionName, ret = new IniSection(sectionName));
|
||||
return ret;
|
||||
}
|
||||
@@ -102,8 +101,7 @@ namespace OpenRA.Mods.Common.FileFormats
|
||||
|
||||
public IniSection GetSection(string s, bool allowFail)
|
||||
{
|
||||
IniSection section;
|
||||
if (sections.TryGetValue(s.ToLowerInvariant(), out section))
|
||||
if (sections.TryGetValue(s.ToLowerInvariant(), out var section))
|
||||
return section;
|
||||
|
||||
if (allowFail)
|
||||
@@ -136,8 +134,7 @@ namespace OpenRA.Mods.Common.FileFormats
|
||||
|
||||
public string GetValue(string key, string defaultValue)
|
||||
{
|
||||
string s;
|
||||
return values.TryGetValue(key, out s) ? s : defaultValue;
|
||||
return values.TryGetValue(key, out var s) ? s : defaultValue;
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
|
||||
|
||||
Reference in New Issue
Block a user