Pattern: Use of Span<T>.Fill()
instead of Span<T>.Clear()
Issue: -
It's more efficient to call Span<T>.Clear()
than to call Span<T>.Fill(T)
to fill the elements of the span with a default value.
Example of incorrect code:
void M(Span<byte> span)
{
span.Fill(0);
}
Example of correct code:
void M(Span<byte> span)
{
span.Clear();
}