Add suport for adding new items which are sorted without reloading the entrie list
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user