-
Notifications
You must be signed in to change notification settings - Fork 10k
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 CA1821, CA1825-CA1834 #33041
Enable CA1821, CA1825-CA1834 #33041
Conversation
1315a9f
to
6954fe0
Compare
Contributes to #24055
6954fe0
to
5d0ede4
Compare
@@ -46,7 +46,7 @@ public static byte[] FromBase32(string input) | |||
input = input.TrimEnd('=').ToUpperInvariant(); | |||
if (input.Length == 0) | |||
{ | |||
return new byte[0]; | |||
return Array.Empty<byte>(); |
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.
Why do we even have this class?!
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 hear you have to use base32 if you are on a 32-bit processor.
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.
This was mostly just to get the finicky authenticator apps to work properly with TFA, its possible we don't need this helper anymore, but that's why it was added originally
@@ -210,7 +210,7 @@ private List<GCHandle> PinDataBuffers(bool endOfRequest, ArraySegment<byte> data | |||
else if (!hasData && !addTrailers) | |||
{ | |||
// No data | |||
dataChunks = new HttpApiTypes.HTTP_DATA_CHUNK[0]; | |||
dataChunks = Array.Empty<HttpApiTypes.HTTP_DATA_CHUNK>(); |
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.
This will be pinned and passed to native code, are there any weird implications with using the global empty array in that case?
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.
@Tratcher, thoughts?
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's probably better to pin a singleton like this than an object in gen0. The pin for these is usually very short anyways.
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 did not review blazor/mvc/razor.
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.
Identity changes look fine, only random tidbit I have is I remember Diego back in the day told me to avoid using Any with EF because for whatever reason was way slower on than Count() > 0... but 🤷
@ajcvickers what are your thoughts❔ |
@dougbu |
Hi @ajcvickers. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
* Enable CA1821, CA1825-CA1834 Contributes to dotnet/aspnetcore#24055 Commit migrated from dotnet/aspnetcore@e4f7bfb43524
Contributes to #24055