refactor: Implemented analyzer suggestions and smaller refactorings#937
Merged
refactor: Implemented analyzer suggestions and smaller refactorings#937
Conversation
egil
reviewed
Dec 14, 2022
egil
previously approved these changes
Dec 14, 2022
Collaborator
Author
|
I don't wanna jinx anything here, but since we removed the |
egil
reviewed
Dec 14, 2022
src/bunit.web/TestDoubles/Authorization/FakeAuthorizationService.cs
Outdated
Show resolved
Hide resolved
egil
previously approved these changes
Dec 14, 2022
Member
|
@linkdotnet there is very little overhead in doing multiple iterations over what is very likely to be a list or array already, but even so, I could not help myself and did try to avoid the ToArray/ToList call in one place. In reality, just doing multiple enumerations over the innumerable are completely fine in the cases affected by this PR, since that IEnumerable is very likely going to be in memory already, so this could also be a case we can just ignore the analyzer. EDIT: ok nevermind just broke it :) |
egil
approved these changes
Dec 15, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was meant to fix some of the new analyzers shipped with
net7.0that got activated with7.0.1.What did I do?
IEnumerablewas enumerated multiple times, I created aListforeachloops