MaxRefCountList.cs 636 B

123456789101112131415161718192021222324
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. namespace System.Linq
  7. {
  8. internal sealed class MaxRefCountList<T> : IRefCountList<T>
  9. {
  10. private readonly IList<T> _list = [];
  11. public void Clear() => _list.Clear();
  12. public int Count => _list.Count;
  13. public T this[int i] => _list[i];
  14. public void Add(T item) => _list.Add(item);
  15. public void Done(int index) { }
  16. }
  17. }