From a7ccfc553ac2d724152c5121ec8fc8d5f0ef1661 Mon Sep 17 00:00:00 2001 From: Jonathan Steele Date: Tue, 19 Nov 2024 20:02:58 -0500 Subject: [PATCH] remove InsertIntoSortedCollection --- NewsViewModel.cs | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/NewsViewModel.cs b/NewsViewModel.cs index b0f4c6d..e38b9db 100644 --- a/NewsViewModel.cs +++ b/NewsViewModel.cs @@ -37,30 +37,6 @@ await MainThread.InvokeOnMainThreadAsync(async () => }); } - static void InsertIntoSortedCollection(ObservableCollection collection, Comparison comparison, T modelToInsert) - { - if (collection.Count is 0) - { - collection.Add(modelToInsert); - } - else - { - var index = 0; - foreach (var model in collection) - { - if (comparison(model, modelToInsert) >= 0) - { - collection.Insert(index, modelToInsert); - return; - } - - index++; - } - - collection.Insert(index, modelToInsert); - } - } - private async IAsyncEnumerable GetTopStoriesAsync() { List topStoryIds;