[Help] Cleanup

This commit is contained in:
Matt Nadareski
2019-02-08 13:51:10 -08:00
parent b8cd0a10bb
commit e108c02eaa

View File

@@ -36,33 +36,20 @@ namespace SabreTools.Library.Help
get
{
if (_features == null)
{
_features = new Dictionary<string, Feature>();
}
if (!_features.ContainsKey(name))
{
return null;
}
return _features[name];
}
set
{
if (_features == null)
{
_features = new Dictionary<string, Feature>();
}
if (_features.ContainsKey(name))
{
_features[name] = value;
}
else
{
_features.Add(name, value);
}
}
}
public Feature this[Feature subfeature]
@@ -70,33 +57,20 @@ namespace SabreTools.Library.Help
get
{
if (_features == null)
{
_features = new Dictionary<string, Feature>();
}
if (!_features.ContainsKey(subfeature.Name))
{
return null;
}
return _features[subfeature.Name];
}
set
{
if (_features == null)
{
_features = new Dictionary<string, Feature>();
}
if (_features.ContainsKey(subfeature.Name))
{
_features[subfeature.Name] = value;
}
else
{
_features.Add(subfeature.Name, value);
}
}
}
/// <summary>
@@ -106,9 +80,7 @@ namespace SabreTools.Library.Help
public void Add(Feature feature)
{
if (_features == null)
{
_features = new Dictionary<string, Feature>();
}
lock (_features)
{
@@ -301,9 +273,8 @@ namespace SabreTools.Library.Help
foreach (KeyValuePair<string, Feature> tempfeat in temp)
{
if (!enabled.ContainsKey(tempfeat.Key))
{
enabled.Add(tempfeat.Key, null);
}
enabled[tempfeat.Key] = tempfeat.Value;
}
}