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

Commit

Permalink
Don't use task if not necessary in GetPropertiesForTypeAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
netonjm committed Oct 10, 2019
1 parent 4cf919e commit 0c656ac
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ public Task<object> CreateObjectAsync (ITypeInfo type)

public Task<IReadOnlyCollection<IPropertyInfo>> GetPropertiesForTypeAsync (ITypeInfo type)
{
return Task.Run (() => {
var prov = target?.Providers ?? Array.Empty<object> ();
return (IReadOnlyCollection<IPropertyInfo>)GetPropertiesForProviders (prov);
});
var prov = target?.Providers ?? Array.Empty<object> ();
var providers = (IReadOnlyCollection<IPropertyInfo>)GetPropertiesForProviders (prov);
return Task.FromResult (providers);
}

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

0 comments on commit 0c656ac

Please sign in to comment.