-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
dotnet/roslyn-analyzers
#5181Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Memorycode-analyzerMarks an issue that suggests a Roslyn analyzerMarks an issue that suggests a Roslyn analyzer
Milestone
Description
(Copied from #30740 (comment).)
Consider replacing this:
Span<T> theSpan = GetSpan();
theSpan.Fill(default(T));
With this:
Span<T> theSpan = GetSpan();
theSpan.Clear();
I see a handful of uses of Fill(0)
or Fill(default)
throughout the codebase (see callers). The Clear()
method is potentially much more optimized than the Fill
method depending on the T in use.
Category: Performance
rabbitism, Gnbrkm41 and AmrAlSayed0
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Memorycode-analyzerMarks an issue that suggests a Roslyn analyzerMarks an issue that suggests a Roslyn analyzer