summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2019-01-11 15:04:11 -0500
committerJan Kotas <jkotas@microsoft.com>2019-01-11 12:04:11 -0800
commitc5ab4466175ec58069adabb51995c571234512cd (patch)
treec77f51b9b3a7779b42c5f2dc3010e2aba545cb85 /scripts
parent55b0d2790c75efe2b4a29a561127599668658e05 (diff)
downloadcoreclr-c5ab4466175ec58069adabb51995c571234512cd.tar.gz
coreclr-c5ab4466175ec58069adabb51995c571234512cd.tar.bz2
coreclr-c5ab4466175ec58069adabb51995c571234512cd.zip
Add missing overrides to SyncTextWriter (#21956)
Several recently added virtuals to TextWriter were missing overrides on SyncTextWriter. We were missing overrides of the synchronous `Write(ReadOnlySpan<char>)` and `WriteLine(ReadOnlySpan<char>)` overloads. The impact here is primarily performance, though it'll still be an observable change in corner-case scenarios: rather than using the base implementation which would copy the span to an array and then invoke the properly overridden array-based Write{Line} methods, it'll now just delegate to the wrapped span methods. So it calls the correct overload now on the wrapped instance, and saves some cost in the process. We were also missing overrides for the async `WriteLineAsync()`, `WriteAsync(ReadOnlyMemory<char>, CancellationToken)`, WriteLineAsync(ReadOnlyMemory<char>, CancellationToken)` overloads. Fixing these doesn't change the overload that's invoked on the wrapped writer, but it does cause the calls to become synchronous rather than queue a task that in turn calls the synchronized overload. Whether the new behavior is better is arguable, but it keeps it consistent with every other XxAsync method on SyncTextWriter, which in my opinion is more important... if we wanted to alter the behavior for all of the XxAsync methods, we should do it for all of them. Also, in the StringBuilder-based overrides, we were ignoring cancellation. And in the recently added DisposeAsync, we should follow-suit with the rest of the async APIs and make it synchronous.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions