Browse Source

Remove unused allocation/assignment.

Daniel C. Weber 7 years ago
parent
commit
ab2e319b23
1 changed files with 2 additions and 4 deletions
  1. 2 4
      Rx.NET/Source/src/System.Reactive/EventPatternSourceBase.cs

+ 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();