diff --git a/src/Avalonia.Controls/SelectionModelChangeSet.cs b/src/Avalonia.Controls/SelectionModelChangeSet.cs index bff84eca92..6e77dc5755 100644 --- a/src/Avalonia.Controls/SelectionModelChangeSet.cs +++ b/src/Avalonia.Controls/SelectionModelChangeSet.cs @@ -7,7 +7,7 @@ namespace Avalonia.Controls { internal class SelectionModelChangeSet { - private List _changes; + private readonly List _changes; public SelectionModelChangeSet(List changes) { @@ -63,7 +63,7 @@ namespace Avalonia.Controls { static int GetCount(SelectionNodeOperation info) => info.DeselectedCount; static List? GetRanges(SelectionNodeOperation info) => info.DeselectedRanges; - return GetIndexAt(infos, index, GetCount, GetRanges); + return GetIndexAt(infos, index, x => GetCount(x), x => GetRanges(x)); } private IndexPath GetSelectedIndexAt( @@ -72,7 +72,7 @@ namespace Avalonia.Controls { static int GetCount(SelectionNodeOperation info) => info.SelectedCount; static List? GetRanges(SelectionNodeOperation info) => info.SelectedRanges; - return GetIndexAt(infos, index, GetCount, GetRanges); + return GetIndexAt(infos, index, x => GetCount(x), x => GetRanges(x)); } private object? GetDeselectedItemAt( @@ -81,7 +81,7 @@ namespace Avalonia.Controls { static int GetCount(SelectionNodeOperation info) => info.Items != null ? info.DeselectedCount : 0; static List? GetRanges(SelectionNodeOperation info) => info.DeselectedRanges; - return GetItemAt(infos, index, GetCount, GetRanges); + return GetItemAt(infos, index, x => GetCount(x), x => GetRanges(x)); } private object? GetSelectedItemAt( @@ -90,7 +90,7 @@ namespace Avalonia.Controls { static int GetCount(SelectionNodeOperation info) => info.Items != null ? info.SelectedCount : 0; static List? GetRanges(SelectionNodeOperation info) => info.SelectedRanges; - return GetItemAt(infos, index, GetCount, GetRanges); + return GetItemAt(infos, index, x => GetCount(x), x => GetRanges(x)); } private IndexPath GetIndexAt(