From d6593aac3150680bff0d88512511f98d67d012a0 Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Sun, 12 May 2024 22:02:51 +0100 Subject: [PATCH] Add suport for adding new items which are sorted without reloading the entrie list --- Toolkit.Foundation/Cache.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Toolkit.Foundation/Cache.cs b/Toolkit.Foundation/Cache.cs index f86b219..2b3ae64 100644 --- a/Toolkit.Foundation/Cache.cs +++ b/Toolkit.Foundation/Cache.cs @@ -4,10 +4,11 @@ using System.Reactive.Disposables; namespace Toolkit.Foundation; -public class Cache(IDisposer disposer) : +public class Cache(IDisposer disposer, + IComparer comparer) : ICache { - private readonly List cache = []; + private readonly SortedSet cache = new(comparer); public void Add(TValue value) {