src/AnvilPacker/Util/CollectionExtensions.cs
/// <summary> Returns the number of values equal to the specified value. </summary>
Returns the number of values equal to the specified value.
Returns the number of values equal to the specified value .
public static int Count<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T>
        {
            int count = 0;
            foreach (var elem in span) {
                if (elem.Equals(value)) {
                    count++;
                }
            }
            return count;
        }
public static int Count < T > ( this ReadOnlySpan < T > span , T value ) where T : IEquatable < T > { int count = 0 ; foreach ( var elem in span ) { if ( elem . Equals ( value ) ) { count ++ ; } } return count ; }
Returns the number of values equal to the specified value.
Returns the number of values equal to the specified value .
ReadOnlySpan<T>
this
value
T