-
Notifications
You must be signed in to change notification settings - Fork 631
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
Enable Microsoft Code Analysis #1782
base: development
Are you sure you want to change the base?
Conversation
var length = (ushort) ms.Position; | ||
rawPdu.GetCommonFields(buffer, length); | ||
await stream.WriteAsync(buffer.Bytes, 0, RawPDU.CommonFieldsLength + length, cancellationToken).ConfigureAwait(false); | ||
RawPDU pdu = 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.
Small note here: "await using" is compiler syntax sugar for DisposeAsync
being called inside an automatically generated finally
block.
Unfortunately there is no easy way to say "also add ConfigureAwait(false)
", so this syntax sugar needed to be unwrapped manually.
I could also suppress the warning here, since the method RawPDU.DisposeAsync
doesn't actually do anything async for now, but that felt more dangerous.
Fixes #1781
Checklist
I have updated the change logChanges proposed in this pull request:
Screenshot of what it looks like now if you forget ConfigureAwait(false):