diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.Emulation.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.Emulation.cs index f1577ef660..403596edd7 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.Emulation.cs +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.Emulation.cs @@ -396,8 +396,6 @@ private void Tick(Action, TimeSpan> recurse) while (true) { - var shouldWaitForResume = false; - lock (_gate) { if (_runState == RUNNING) @@ -430,7 +428,6 @@ private void Tick(Action, TimeSpan> recurse) // will pick up the cumulative inactive time delta. // Debug.Assert(_runState == SUSPENDED); - shouldWaitForResume = true; } // @@ -440,10 +437,7 @@ private void Tick(Action, TimeSpan> recurse) // be extremely unlucky to find ourselves SUSPENDED again and be blocked // once more. // - if (shouldWaitForResume) - { - _resumeEvent.WaitOne(); - } + _resumeEvent.WaitOne(); } recurse(this, next); diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.cs index 6979a46eb5..f4e2b325de 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.cs +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.cs @@ -13,7 +13,7 @@ public static partial class Scheduler internal static Type[] OPTIMIZATIONS = { typeof(ISchedulerLongRunning), typeof(IStopwatchProvider), - typeof(ISchedulerPeriodic), + typeof(ISchedulerPeriodic) /* update this list if new interface-based optimizations are added */ }; diff --git a/Rx.NET/Source/src/System.Reactive/Linq/Observable/CombineLatest.cs b/Rx.NET/Source/src/System.Reactive/Linq/Observable/CombineLatest.cs index 2fc6a03c01..426fb9b535 100644 --- a/Rx.NET/Source/src/System.Reactive/Linq/Observable/CombineLatest.cs +++ b/Rx.NET/Source/src/System.Reactive/Linq/Observable/CombineLatest.cs @@ -179,7 +179,6 @@ public void OnNext(TSecond value) else if (_other.Done) { _parent.ForwardOnCompleted(); - return; } } } diff --git a/Rx.NET/Source/src/System.Reactive/Linq/Observable/SelectMany.cs b/Rx.NET/Source/src/System.Reactive/Linq/Observable/SelectMany.cs index b6a7babc0f..20380cfc49 100644 --- a/Rx.NET/Source/src/System.Reactive/Linq/Observable/SelectMany.cs +++ b/Rx.NET/Source/src/System.Reactive/Linq/Observable/SelectMany.cs @@ -392,12 +392,12 @@ public override void OnNext(TSource value) return; } - try + using (e) { var hasNext = true; + while (hasNext) { - hasNext = false; var current = default(TResult); try @@ -420,13 +420,6 @@ public override void OnNext(TSource value) } } } - finally - { - if (e != null) - { - e.Dispose(); - } - } } } } @@ -488,13 +481,13 @@ public override void OnNext(TSource value) return; } - try + using (e) { var eIndex = 0; var hasNext = true; + while (hasNext) { - hasNext = false; var current = default(TResult); try @@ -517,13 +510,6 @@ public override void OnNext(TSource value) } } } - finally - { - if (e != null) - { - e.Dispose(); - } - } } } } @@ -1367,12 +1353,12 @@ public override void OnNext(TSource value) return; } - try + using (e) { var hasNext = true; + while (hasNext) { - hasNext = false; var current = default(TResult); try @@ -1395,13 +1381,6 @@ public override void OnNext(TSource value) } } } - finally - { - if (e != null) - { - e.Dispose(); - } - } } } } @@ -1457,12 +1436,12 @@ public override void OnNext(TSource value) return; } - try + using (e) { var hasNext = true; + while (hasNext) { - hasNext = false; var current = default(TResult); try @@ -1485,13 +1464,6 @@ public override void OnNext(TSource value) } } } - finally - { - if (e != null) - { - e.Dispose(); - } - } } } }