Add suport for adding new items which are sorted without reloading the entrie list

This commit is contained in:
TheXamlGuy
2024-05-12 22:02:51 +01:00
parent 1e9cb4b4b6
commit d6593aac31
+3 -2
View File
@@ -4,10 +4,11 @@ using System.Reactive.Disposables;
namespace Toolkit.Foundation; namespace Toolkit.Foundation;
public class Cache<TValue>(IDisposer disposer) : public class Cache<TValue>(IDisposer disposer,
IComparer<TValue> comparer) :
ICache<TValue> ICache<TValue>
{ {
private readonly List<TValue> cache = []; private readonly SortedSet<TValue> cache = new(comparer);
public void Add(TValue value) public void Add(TValue value)
{ {