Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize ReusableStringWriter.Write/WriteLine(ReadOnlySpan<char>) met…
…hods Original StringWriter.Write/WriteLine(ReadOnlySpan<char>) methods are optimized only for the StringWriter type itself, not derived classes. For derived classes, these methods copy the provided Span to an array from ArrayPool and fall back to Write(char[], int, int) method for backward compatibility with code created before the Span type existed. Explicit overrides in the ReusableStringWriter class that call StringBuilder.Append directly help to avoid the overhead of ArrayPool.Rent/Return and copying.
- Loading branch information