Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 2b19864

Browse files
committed
Don't use task if not necessary in GetPropertiesForTypeAsync
1 parent 60fa09a commit 2b19864

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/NativePropertyEditor/ComponentModelEditorProvider.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ public Task<object> CreateObjectAsync (ITypeInfo type)
7676

7777
public Task<IReadOnlyCollection<IPropertyInfo>> GetPropertiesForTypeAsync (ITypeInfo type)
7878
{
79-
return Task.Run (() => {
80-
var prov = target?.Providers ?? Array.Empty<object> ();
81-
return (IReadOnlyCollection<IPropertyInfo>)GetPropertiesForProviders (prov);
82-
});
79+
var prov = target?.Providers ?? Array.Empty<object> ();
80+
var providers = (IReadOnlyCollection<IPropertyInfo>)GetPropertiesForProviders (prov);
81+
return Task.FromResult (providers);
8382
}
8483

8584
public static IReadOnlyList<DescriptorPropertyInfo> GetPropertiesForProviders (object[] providers)

0 commit comments

Comments
 (0)