<Member Name="Slice(System.Int32,System.Int32)" />
<Member Name="Equals(System.Object)" />
<Member Name="DangerousCreate(System.Object,T@,System.Int32)" />
+ <Member Name="Clear" />
+ <Member Name="Fill(T)" />
<Member Name="GetHashCode" />
<Member Name="CopyTo(System.Span<T>)" />
<Member Name="TryCopyTo(System.Span<T>)" />
return ref Unsafe.Add(ref _pointer.Value, index);
}
+ /// <summary>
+ /// Clears the contents of this span.
+ /// </summary>
+ public void Clear()
+ {
+ // TODO: Optimize - https://github.com/dotnet/coreclr/issues/9161
+ for (int i = 0; i < _length; i++)
+ {
+ this[i] = default(T);
+ }
+ }
+
+ /// <summary>
+ /// Fills the contents of this span with the given value.
+ /// </summary>
+ public void Fill(T value)
+ {
+ // TODO: Optimize - https://github.com/dotnet/coreclr/issues/9161
+ for (int i = 0; i < _length; i++)
+ {
+ this[i] = value;
+ }
+ }
+
/// <summary>
/// Copies the contents of this span into destination span. If the source
/// and destinations overlap, this method behaves as if the original values in