From 8d742335f246cf8ed20ba76cc0ee06381aaa08af Mon Sep 17 00:00:00 2001 From: Edward Miller Date: Sat, 13 Apr 2024 10:58:44 -0500 Subject: [PATCH] reduce list copies --- Maui.DataGrid/DataGrid.xaml.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Maui.DataGrid/DataGrid.xaml.cs b/Maui.DataGrid/DataGrid.xaml.cs index 68f1a55..569bbce 100644 --- a/Maui.DataGrid/DataGrid.xaml.cs +++ b/Maui.DataGrid/DataGrid.xaml.cs @@ -133,7 +133,7 @@ private bool CanSort(SortData? sortData) return true; } - private IList GetSortedItems(IList unsortedItems, SortData sortData) + private IEnumerable GetSortedItems(IList unsortedItems, SortData sortData) { var columnToSort = Columns[sortData.Index]; @@ -169,7 +169,7 @@ private IList GetSortedItems(IList unsortedItems, SortData sortD throw new NotImplementedException(); } - return items.ToList(); + return items; } #endregion Sorting methods @@ -222,7 +222,7 @@ private void SortAndPaginate(SortData? sortData = null) return; } - IList sortedItems; + IEnumerable sortedItems; if (sortData != null && CanSort(sortData)) {