Skip to content

Commit 7ba2078

Browse files
Explain why we need a cast to ICollection here
1 parent 0e6d31d commit 7ba2078

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

projects/client/RabbitMQ.Client/src/util/SynchronizedList.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public T this[int index]
4444
internal SynchronizedList(IList<T> list)
4545
{
4646
this.list = list;
47-
this.root = ((ICollection)list).SyncRoot;
47+
// ICollection provides SyncRoot
48+
this.root = ((ICollection)list.SyncRoot;
4849
}
4950

5051
public void Add(T item)

0 commit comments

Comments
 (0)