Simplified code (#750)

This commit is contained in:
Thomas Struller-Baumann
2018-11-30 00:45:16 +01:00
committed by Karl Burtram
parent 2f1097028f
commit b00f829317

View File

@@ -35,7 +35,7 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlContext
private T GetSettingOrDefault<T>(Func<ISqlToolsSettingsValues, T> lookup)
where T : new()
{
T value = priorityList.Select( (settings) => lookup(settings)).Where(val => val != null).FirstOrDefault();
T value = priorityList.Select((settings) => lookup(settings)).FirstOrDefault(val => val != null);
return value != null ? value : new T();
}