Skip to content

Commit

Permalink
Merge pull request #1352 from peppy/dont-set-on-get
Browse files Browse the repository at this point in the history
Stop ConfigManager from setting a default when calling GetOriginalBindable
  • Loading branch information
smoogipoo authored Jan 26, 2018
2 parents 332d133 + 1e46bc2 commit 209021f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions osu.Framework/Configuration/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,14 @@ private Bindable<U> set<U>(T lookup, U value)
return bindable;
}

public U Get<U>(T lookup)
{
return GetOriginalBindable<U>(lookup).Value;
}
public U Get<U>(T lookup) => GetOriginalBindable<U>(lookup).Value;

protected Bindable<U> GetOriginalBindable<U>(T lookup)
{
IBindable obj;

if (ConfigStore.TryGetValue(lookup, out obj))
if (ConfigStore.TryGetValue(lookup, out IBindable obj))
return obj as Bindable<U>;

return set(lookup, default(U));
return null;
}

/// <summary>
Expand Down

0 comments on commit 209021f

Please sign in to comment.