Browse Source

There is an unused field in Latest that is only assigned to. On the other hand, access to the _value field happens once inside a lock and once outside. It's most probably a bug and the temporary variable should be used instead.

Daniel Weber 7 years ago
parent
commit
67bb6b7080
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Latest.cs

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

@@ -116,7 +116,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 switch (kind)
                 {
                     case NotificationKind.OnNext:
-                        current = _value;
+                        current = value;
                         return true;
                     case NotificationKind.OnError:
                         error.Throw();