From 22bd56652d35d9dae839b92e3e82b0ccdd785539 Mon Sep 17 00:00:00 2001 From: Westin Miller Date: Sun, 3 Dec 2017 22:05:05 -0800 Subject: [PATCH] Always force a full reset, to reduce the number of undesired resets. --- Torch/Collections/MTObservableCollection.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Torch/Collections/MTObservableCollection.cs b/Torch/Collections/MTObservableCollection.cs index f6fa204..c18fcd6 100644 --- a/Torch/Collections/MTObservableCollection.cs +++ b/Torch/Collections/MTObservableCollection.cs @@ -159,13 +159,6 @@ namespace Torch.Collections } } - private struct DummyToken : IDisposable - { - public void Dispose() - { - } - } - private class DeferredUpdateToken : IDisposable { private readonly MtObservableCollection _collection; @@ -220,7 +213,8 @@ namespace Torch.Collections private void FlushCollectionEventQueue(object data) { - bool reset = _collectionEventQueue.Count >= 2; + // :/, but works better + bool reset = _collectionEventQueue.Count > 0; var itemsChanged = false; while (_collectionEventQueue.TryDequeue(out NotifyCollectionChangedEventArgs e)) if (!reset)