Skip to content

Commit

Permalink
reduce list copies
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Apr 17, 2024
1 parent ae9734a commit 8d74233
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Maui.DataGrid/DataGrid.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private bool CanSort(SortData? sortData)
return true;
}

private IList<object> GetSortedItems(IList<object> unsortedItems, SortData sortData)
private IEnumerable<object> GetSortedItems(IList<object> unsortedItems, SortData sortData)
{
var columnToSort = Columns[sortData.Index];

Expand Down Expand Up @@ -169,7 +169,7 @@ private IList<object> GetSortedItems(IList<object> unsortedItems, SortData sortD
throw new NotImplementedException();
}

return items.ToList();
return items;
}

#endregion Sorting methods
Expand Down Expand Up @@ -222,7 +222,7 @@ private void SortAndPaginate(SortData? sortData = null)
return;
}

IList<object> sortedItems;
IEnumerable<object> sortedItems;

if (sortData != null && CanSort(sortData))
{
Expand Down

0 comments on commit 8d74233

Please sign in to comment.