Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

carlossanlop
Copy link
Contributor

Fixes #159

@carlossanlop carlossanlop self-assigned this Feb 6, 2023
@carlossanlop carlossanlop changed the title Fix null check and parallel for each erors Fix null check and parallel for each errors Feb 6, 2023

CollectFiles();
if (!_docsComments.Types.Any())
if (_docsComments.Types.Count == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use !_docsComments.Types.HasItems() instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CA1860 recommends using Count for perf and readability purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if !HasItems() is more performant than Count == 0. I applied the Roslyn suggestion.

@carlossanlop carlossanlop merged commit 390b71d into dotnet:main Feb 6, 2023
@carlossanlop carlossanlop deleted the FixNullCheckAndParallelForEachErors branch February 6, 2023 23:50
@carlossanlop carlossanlop restored the FixNullCheckAndParallelForEachErors branch April 21, 2023 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Array.Copy Exception when running against System.Formats.Cbor
2 participants