diff --git a/ArchiSteamFarm/Collections/ConcurrentList.cs b/ArchiSteamFarm/Collections/ConcurrentList.cs index 24fd3810f..5dc7c683e 100644 --- a/ArchiSteamFarm/Collections/ConcurrentList.cs +++ b/ArchiSteamFarm/Collections/ConcurrentList.cs @@ -30,7 +30,7 @@ using Nito.AsyncEx; namespace ArchiSteamFarm.Collections; -public sealed class ConcurrentList : IList, IReadOnlyList where T : notnull { +public sealed class ConcurrentList : IList, IReadOnlyList { [PublicAPI] public event EventHandler? OnModified; @@ -58,7 +58,6 @@ public sealed class ConcurrentList : IList, IReadOnlyList where T : not set { ArgumentOutOfRangeException.ThrowIfNegative(index); - ArgumentNullException.ThrowIfNull(value); using (Lock.WriterLock()) { BackingCollection[index] = value; @@ -78,8 +77,6 @@ public sealed class ConcurrentList : IList, IReadOnlyList where T : not } public void Add(T item) { - ArgumentNullException.ThrowIfNull(item); - using (Lock.WriterLock()) { BackingCollection.Add(item); } @@ -96,8 +93,6 @@ public sealed class ConcurrentList : IList, IReadOnlyList where T : not } public bool Contains(T item) { - ArgumentNullException.ThrowIfNull(item); - using (Lock.ReaderLock()) { return BackingCollection.Contains(item); } @@ -116,8 +111,6 @@ public sealed class ConcurrentList : IList, IReadOnlyList where T : not public IEnumerator GetEnumerator() => new ConcurrentEnumerator(BackingCollection, Lock.ReaderLock()); public int IndexOf(T item) { - ArgumentNullException.ThrowIfNull(item); - using (Lock.ReaderLock()) { return BackingCollection.IndexOf(item); } @@ -125,7 +118,6 @@ public sealed class ConcurrentList : IList, IReadOnlyList where T : not public void Insert(int index, T item) { ArgumentOutOfRangeException.ThrowIfNegative(index); - ArgumentNullException.ThrowIfNull(item); using (Lock.WriterLock()) { BackingCollection.Insert(index, item); @@ -135,8 +127,6 @@ public sealed class ConcurrentList : IList, IReadOnlyList where T : not } public bool Remove(T item) { - ArgumentNullException.ThrowIfNull(item); - using (Lock.WriterLock()) { if (!BackingCollection.Remove(item)) { return false;