Skip to content

Remove redundant #if NET in CollectionHelpers.ValidateCopyToArguments#128464

Open
iikuzmychov wants to merge 1 commit into
dotnet:mainfrom
iikuzmychov:cleanup/collection-helpers-redundant-if
Open

Remove redundant #if NET in CollectionHelpers.ValidateCopyToArguments#128464
iikuzmychov wants to merge 1 commit into
dotnet:mainfrom
iikuzmychov:cleanup/collection-helpers-redundant-if

Conversation

@iikuzmychov
Copy link
Copy Markdown

@iikuzmychov iikuzmychov commented May 22, 2026

Both branches of the first #if NET / #else in CollectionHelpers.ValidateCopyToArguments called ArgumentNullException.ThrowIfNull(array); identically. Removed the preprocessor split.

Both branches of the conditional called ArgumentNullException.ThrowIfNull(array)
identically, so the #if/#else served no purpose.
Copilot AI review requested due to automatic review settings May 22, 2026 00:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Removes redundant conditional compilation around a null check in CollectionHelpers, simplifying the method without changing behavior.

Changes:

  • Deleted #if NET / #else / #endif directives that wrapped identical code.
  • Kept a single ArgumentNullException.ThrowIfNull(array); call.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label May 22, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-collections
See info in area-owners.md if you want to be subscribed.

@iikuzmychov iikuzmychov changed the title Remove redundant #if NET in CollectionHelpers.ValidateCopyToArguments Remove redundant #if NET in CollectionHelpers.ValidateCopyToArguments May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Collections community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants