From a6fa1120507df6e9e79d90ca70e7083674b56b04 Mon Sep 17 00:00:00 2001 From: Brant Martin Date: Wed, 5 Jun 2019 13:56:28 -0400 Subject: [PATCH] Fix random MT error in SortedView --- Torch/Collections/SortedView.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Torch/Collections/SortedView.cs b/Torch/Collections/SortedView.cs index bfa5953..db1476f 100644 --- a/Torch/Collections/SortedView.cs +++ b/Torch/Collections/SortedView.cs @@ -107,7 +107,10 @@ namespace Torch.Collections public void Refresh() { _store.Clear(); - _store.AddRange(_backing); + //_store.AddRange(_backing); + _store.EnsureCapacity(_backing.Count); + foreach (var e in _backing) + _store.Add(e); Sort(); }