Clear()
to set the items in a Span<T>
to their default values CS-P1023The Fill()
method fills Span<T>
with the value specified. However, consider using the Clear()
method instead if you wish to set the items to the default values as it is more performant and designed for this exact purpose.
span.Fill(0);
span.Clear();