浏览代码

Use the Count-property on a list instead of enumerating it with Count(). (#596)

Daniel C. Weber 7 年之前
父节点
当前提交
3cbc73ffac
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Rx.NET/Source/src/System.Reactive/Disposables/CompositeDisposable.cs

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Disposables/CompositeDisposable.cs

@@ -110,7 +110,7 @@ namespace System.Reactive.Disposables
             _disposables = list;
             // _count can be read by other threads and thus should be properly visible
             // also releases the _disposables contents so it becomes thread-safe
-            Volatile.Write(ref _count, _disposables.Count());
+            Volatile.Write(ref _count, _disposables.Count);
         }
 
         /// <summary>