From 1e46bc2bfaf708ce9c3bf2ed8c01cb7fed8f6505 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 26 Jan 2018 08:12:05 +0900 Subject: [PATCH] Stop ConfigManager from setting a default when calling GetOriginalBindable This behaviour wasn't even correct as `default(U)` would not match the expected type for cases like `BindableDouble`. --- osu.Framework/Configuration/ConfigManager.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/osu.Framework/Configuration/ConfigManager.cs b/osu.Framework/Configuration/ConfigManager.cs index 33ddaad38c..ad7847ecf5 100644 --- a/osu.Framework/Configuration/ConfigManager.cs +++ b/osu.Framework/Configuration/ConfigManager.cs @@ -129,19 +129,14 @@ private Bindable set(T lookup, U value) return bindable; } - public U Get(T lookup) - { - return GetOriginalBindable(lookup).Value; - } + public U Get(T lookup) => GetOriginalBindable(lookup).Value; protected Bindable GetOriginalBindable(T lookup) { - IBindable obj; - - if (ConfigStore.TryGetValue(lookup, out obj)) + if (ConfigStore.TryGetValue(lookup, out IBindable obj)) return obj as Bindable; - return set(lookup, default(U)); + return null; } ///