Skip to content

Commit

Permalink
Makes LoadData more efficient.
Browse files Browse the repository at this point in the history
  • Loading branch information
djanosik committed Oct 27, 2017
1 parent 8a2ae3e commit 566489a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DotVVM.Core/Controls/GridViewDataSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ protected virtual async Task NotifyRefreshRequired()
}
}

private async Task<GridViewDataSetLoadedData<T>> LoadData()
private Task<GridViewDataSetLoadedData<T>> LoadData()
{
if (OnLoadingData != null && OnLoadingDataAsync != null)
{
Expand All @@ -348,15 +348,15 @@ private async Task<GridViewDataSetLoadedData<T>> LoadData()

if (OnLoadingData != null)
{
return OnLoadingData(CreateGridViewDataSetLoadOptions());
return Task.FromResult(OnLoadingData(CreateGridViewDataSetLoadOptions()));
}

if (OnLoadingDataAsync != null)
{
return await OnLoadingDataAsync(CreateGridViewDataSetLoadOptions());
return OnLoadingDataAsync(CreateGridViewDataSetLoadOptions());
}

return null;
return Task.FromResult<GridViewDataSetLoadedData<T>>(null);
}
}

Expand Down

0 comments on commit 566489a

Please sign in to comment.