Skip to content

Conversation

@JamieMagee
Copy link
Member

Count() is a LINQ extension method, whereas Count is a property of the collection.

See: https://stackoverflow.com/questions/4098186/lists-count-vs-count

`Count()` is a LINQ extension method, whereas `Count` is a property of the collection.

See: https://stackoverflow.com/questions/4098186/lists-count-vs-count
@JamieMagee JamieMagee added the type:refactor Refactoring or improving of existing code label Feb 2, 2022
@JamieMagee JamieMagee requested a review from a team as a code owner February 2, 2022 21:56
@JamieMagee JamieMagee requested a review from tevoinea February 2, 2022 21:56
@jcfiorenzano
Copy link
Contributor

what is the reason for this?

I understand that Count is more performant than Count().
Do we have data about this is affecting us?
Are we going to remove every linq use in this repo.
When new contributors create PRs, is this something that need to look at?

@JamieMagee
Copy link
Member Author

what is the reason for this?

It's a small refactor that Visual Studio suggested to me as a build warning. Very low risk IMO.

I understand that Count is more performant than Count().
Do we have data about this is affecting us?

Not about us specifically, but it is a minor optimization.

Are we going to remove every linq use in this repo

No, but this was a build warning.

When new contributors create PRs, is this something that need to look at?

If we fix build warnings, and make warnings errors, this should fix the issue.

@JamieMagee JamieMagee merged commit 8e6f9d5 into main Feb 2, 2022
@JamieMagee JamieMagee deleted the users/jamagee/count branch February 2, 2022 22:49
@github-actions
Copy link

github-actions bot commented Feb 2, 2022

👋 Hi! It looks like you modified some files in the Detectors folder.
You may need to bump the detector versions if any of the following scenarios apply:

  • The detector detects more or fewer components than before
  • The detector generates different parent/child graph relationships than before
  • The detector generates different devDependencies values than before

If none of the above scenarios apply, feel free to ignore this comment 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:refactor Refactoring or improving of existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants