Преглед изворни кода

Save one static per-generic-class field.

Daniel Weber пре 7 година
родитељ
комит
d011957489
1 измењених фајлова са 2 додато и 3 уклоњено
  1. 2 3
      Rx.NET/Source/src/System.Reactive/Linq/Observable/RetryWhen.cs

+ 2 - 3
Rx.NET/Source/src/System.Reactive/Linq/Observable/RetryWhen.cs

@@ -161,7 +161,6 @@ namespace System.Reactive.Linq.ObservableImpl
         private readonly IObserver<X> _downstream;
         private int _wip;
         private Exception _terminalException;
-        private static readonly Exception DoneIndicator = new Exception();
         private static readonly Exception SignaledIndicator = new Exception();
         private readonly ConcurrentQueue<X> _queue;
 
@@ -173,7 +172,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
         public void OnCompleted()
         {
-            if (Interlocked.CompareExchange(ref _terminalException, DoneIndicator, null) == null)
+            if (Interlocked.CompareExchange(ref _terminalException, ExceptionHelper.Terminated, null) == null)
             {
                 Drain();
             }
@@ -218,7 +217,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     if (ex != SignaledIndicator)
                     {
                         Interlocked.Exchange(ref _terminalException, SignaledIndicator);
-                        if (ex != DoneIndicator)
+                        if (ex != ExceptionHelper.Terminated)
                         {
                             _downstream.OnError(ex);
                         }