Pārlūkot izejas kodu

Remove unused allocation/assignment.

Daniel C. Weber 7 gadi atpakaļ
vecāks
revīzija
ab2e319b23

+ 2 - 4
Rx.NET/Source/src/System.Reactive/EventPatternSourceBase.cs

@@ -92,8 +92,7 @@ namespace System.Reactive
         {
             lock (_subscriptions)
             {
-                var l = new Stack<IDisposable>();
-                if (!_subscriptions.TryGetValue(handler, out l))
+                if (!_subscriptions.TryGetValue(handler, out var l))
                 {
                     _subscriptions[handler] = l = new Stack<IDisposable>();
                 }
@@ -118,8 +117,7 @@ namespace System.Reactive
 
             lock (_subscriptions)
             {
-                var l = new Stack<IDisposable>();
-                if (_subscriptions.TryGetValue(handler, out l))
+                if (_subscriptions.TryGetValue(handler, out var l))
                 {
                     d = l.Pop();