Better SortedView fix
This commit is contained in:
@@ -110,19 +110,12 @@ namespace Torch.Collections
|
|||||||
|
|
||||||
public void Refresh()
|
public void Refresh()
|
||||||
{
|
{
|
||||||
//HACK, fix the multithreading
|
_store.Clear();
|
||||||
try
|
//_store.AddRange(_backing);
|
||||||
{
|
_store.EnsureCapacity(_backing.Count);
|
||||||
_store.Clear();
|
foreach (var e in _backing)
|
||||||
_store.AddRange(_backing);
|
_store.Add(e);
|
||||||
Sort();
|
Sort();
|
||||||
}
|
|
||||||
catch (IndexOutOfRangeException e)
|
|
||||||
{
|
|
||||||
_log.Error(e);
|
|
||||||
Thread.Sleep(10);
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetComparer(IComparer<T> comparer, bool resort = true)
|
public void SetComparer(IComparer<T> comparer, bool resort = true)
|
||||||
|
Reference in New Issue
Block a user