Use out var syntax

This commit is contained in:
teinarss
2020-08-16 10:49:33 +02:00
committed by Paul Chote
parent d52e4793fe
commit 27f1a7ab27
193 changed files with 395 additions and 826 deletions

View File

@@ -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()