-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Use "..."u8 to simplify some ReadOnlySpan<byte>
constructions
#68334
Conversation
I've focused only on src and only on non-allocating use.
Tagging subscribers to this area: @dotnet/area-meta Issue DetailsI've focused only on easily-findable uses in src and only on non-allocating use.
|
|
||
byte[]? cipherSuites = CipherSuitesPolicyPal.GetOpenSslCipherSuites(sslAuthenticationOptions.CipherSuitesPolicy, protocols, sslAuthenticationOptions.EncryptionPolicy); | ||
Debug.Assert(cipherSuites == null || (cipherSuites.Length >= 1 && cipherSuites[cipherSuites.Length - 1] == 0)); |
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.
you can't do the same trick Debug.Assert(cipherSuites == null || (cipherSuites[^1] == 0));
?
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.
It would still need the cipherSuites >= 1 && ...
, but the cipherSuites.Length - 1
could be replaced by ^1
.
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.
LGTM. I also verified all the ones that were previously numbers.
It looks like concatenation syntax is not supported with |
@stephentoub to make sure he sees the comment above about concatenation.. |
I opened dotnet/roslyn#60896 |
Some of these files were synced to aspnetcore and are failing to build. What is the requirement to get this building? |
Sorry about that; I knew these would sync but forgot to deal with it before merging.
aspnetcore would need to move to a relatively recent compiler. Would you prefer I undo these changes for now, or do you want to upgrade aspnetcore? |
No problem. Leave it in for now. There isn't a rush to merge the sync PR at the moment. |
I've focused only on easily-findable uses in src and only on non-allocating use.