This commit is contained in:
JustArchi
2019-07-28 22:21:15 +02:00
parent fbe41b12a2
commit 806583920e
2 changed files with 3 additions and 4 deletions

View File

@@ -1179,9 +1179,7 @@ namespace ArchiSteamFarm {
// We must call ToList() here as we can't do in-place replace
List<Game> gamesToFarm = orderedGamesToFarm.ToList();
GamesToFarm.Clear();
GamesToFarm.AddRange(gamesToFarm);
GamesToFarm.ReplaceWith(gamesToFarm);
}
internal sealed class Game : IEquatable<Game> {

View File

@@ -113,8 +113,9 @@ namespace ArchiSteamFarm.Collections {
[SuppressMessage("ReSharper", "AnnotationRedundancyInHierarchy")]
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
internal void AddRange([NotNull] IEnumerable<T> collection) {
internal void ReplaceWith([NotNull] IEnumerable<T> collection) {
using (Lock.WriterLock()) {
BackingCollection.Clear();
BackingCollection.AddRange(collection);
}
}