-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Added Write/WriteLine ReadOnlySpan<char> override to HttpResponseStreamWriter #18445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Write/WriteLine ReadOnlySpan<char> override to HttpResponseStreamWriter #18445
Conversation
Tests failures should be unrelated |
I don't think this is the right issue number. |
@@ -161,10 +161,12 @@ public partial class HttpResponseStreamWriter : System.IO.TextWriter | |||
public override System.Threading.Tasks.Task FlushAsync() { throw null; } | |||
public override void Write(char value) { } | |||
public override void Write(char[] values, int index, int count) { } | |||
public override void Write(System.ReadOnlySpan<char> values) { } | |||
public override void Write(string value) { } | |||
public override System.Threading.Tasks.Task WriteAsync(char value) { throw null; } | |||
public override System.Threading.Tasks.Task WriteAsync(char[] values, int index, int count) { throw null; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a parallel method for WriteAsync that accepts a ReadOnlyMemory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have #18451 for those, but it is based on this one, so I will mark it ready for review once this is merged. Unless you prefer to combine it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see now!
} | ||
|
||
int written = 0; | ||
while (written < values.Length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: save values.Length in a local rather than checking every iteration of the loop. nvrm you are slicing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkotalik Fixed issue number. Sorry about that.
Partially address #2895
/cc @benaadams