Explorar el Código

Don't check Sink._observer upfront because for a reasonable number of expected calls (< 3), the benefit will not show.

Daniel Weber hace 7 años
padre
commit
9682ba031e
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Rx.NET/Source/src/System.Reactive/Internal/Sink.cs

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Internal/Sink.cs

@@ -26,7 +26,7 @@ namespace System.Reactive
 
         public void Dispose()
         {
-            if (_observer != NopObserver<TTarget>.Instance && Interlocked.Exchange(ref _observer, NopObserver<TTarget>.Instance) != NopObserver<TTarget>.Instance)
+            if (Interlocked.Exchange(ref _observer, NopObserver<TTarget>.Instance) != NopObserver<TTarget>.Instance)
                 Dispose(true);
         }