Browse Source

Push variable declaration into inner scope.

Daniel Weber 7 năm trước cách đây
mục cha
commit
f869f30b37

+ 1 - 3
Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.TimerQueue.cs

@@ -345,11 +345,9 @@ namespace System.Reactive.Concurrency
         {
             lock (StaticGate)
             {
-                var next = default(WorkItem);
-
                 while (LongTerm.Count > 0)
                 {
-                    next = LongTerm.Peek();
+                    var next = LongTerm.Peek();
 
                     var due = Scheduler.Normalize(next.DueTime - next.Scheduler.Now);
                     if (due >= ShortTerm)

+ 1 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/Buffer.cs

@@ -562,7 +562,6 @@ namespace System.Reactive.Linq.ObservableImpl
 
                 private void Tick(int id)
                 {
-                    var newId = 0;
                     lock (_gate)
                     {
                         if (id != _windowId)
@@ -571,7 +570,7 @@ namespace System.Reactive.Linq.ObservableImpl
                         }
 
                         _n = 0;
-                        newId = ++_windowId;
+                        var newId = ++_windowId;
 
                         var res = _s;
                         _s = new List<TSource>();