daily update on 20250214 by nitload youmu, building syntax analysor[D[D[D[D[D[C[C[C[C[C, tough!
This commit is contained in:
@@ -32,11 +32,21 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Commom.Collections
|
||||
{
|
||||
internal class CapacityFixedList<T> : IList<T>
|
||||
public static class CapacityFixedListBuilder
|
||||
{
|
||||
internal static CapacityFixedList<T> Create<T>(ReadOnlySpan<T> values)
|
||||
{
|
||||
return new CapacityFixedList<T>(values);
|
||||
}
|
||||
}
|
||||
|
||||
[CollectionBuilder(typeof(CapacityFixedListBuilder),nameof(CapacityFixedListBuilder.Create))]
|
||||
public class CapacityFixedList<T> : IList<T>
|
||||
{
|
||||
|
||||
private T[] _values;
|
||||
@@ -47,6 +57,11 @@ namespace StgSharp.Commom.Collections
|
||||
_values = new T[size];
|
||||
}
|
||||
|
||||
public CapacityFixedList(ReadOnlySpan<T> values)
|
||||
{
|
||||
_values = values.ToArray();
|
||||
}
|
||||
|
||||
public T this[ int index ]
|
||||
{
|
||||
get => index < _index ?
|
||||
|
||||
Reference in New Issue
Block a user