Use "..."u8 to simplify some ReadOnlySpan<byte> constructions#68334
Use "..."u8 to simplify some ReadOnlySpan<byte> constructions#68334danmoseley merged 1 commit intodotnet:mainfrom
ReadOnlySpan<byte> constructions#68334Conversation
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.
|
| Debug.Assert(cipherList.IsEmpty || cipherList[^1] == 0); | ||
|
|
||
| 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.
you can't do the same trick Debug.Assert(cipherSuites == null || (cipherSuites[^1] == 0));?
There was a problem hiding this comment.
It would still need the cipherSuites >= 1 && ..., but the cipherSuites.Length - 1 could be replaced by ^1.
danmoseley
left a comment
There was a problem hiding this comment.
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.