Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Make FastList Obsolete #2332

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sources/core/Stride.Core/Collections/FastList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
namespace Stride.Core.Collections
{
/// <summary>
/// Similar to <see cref="List{T}"/>, with direct access to underlying array.
/// <para>Similar to <see cref="List{T}"/>, with direct access to underlying array.</para>
/// <para>It is recommended to use Spans instead: <see href="https://github.com/stride3d/stride/discussions/2298#discussioncomment-9779439"/></para>
/// </summary>
/// <typeparam name="T">The type of elements in the list.</typeparam>
[DataSerializer(typeof(ListAllSerializer<,>), Mode = DataSerializerGenericMode.TypeAndGenericArguments)]
[DebuggerDisplay("Count = {" + nameof(Count) + "}")]
[Obsolete(".NET Lists can be faster in the latest .NET versions.")]
public class FastList<T> : IList<T>, IReadOnlyList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
{
// Fields
Expand All @@ -27,6 +29,7 @@ public class FastList<T> : IList<T>, IReadOnlyList<T>, ICollection<T>, IEnumerab
/// Gets the items.
/// </summary>
[DataMemberIgnore]
[Obsolete("Its best to use a List<T> instead of FastList<T> and iterate through the list as a Span for peak performance.")]
public T[] Items { get; private set; }

private int size;
Expand Down