mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Simplified code (#750)
This commit is contained in:
committed by
Karl Burtram
parent
2f1097028f
commit
b00f829317
@@ -35,7 +35,7 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlContext
|
|||||||
private T GetSettingOrDefault<T>(Func<ISqlToolsSettingsValues, T> lookup)
|
private T GetSettingOrDefault<T>(Func<ISqlToolsSettingsValues, T> lookup)
|
||||||
where T : new()
|
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();
|
return value != null ? value : new T();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user