Skip to content

Conversation

@MihaZupan
Copy link
Member

@MihaZupan MihaZupan commented Nov 26, 2025

Same idea as #122001 - simplifications without behavioral changes to make future changes easier to review.

In this case there's no need to flow around the exception argument if all callers just care about a yes/no.

@MihaZupan MihaZupan added this to the 11.0.0 milestone Nov 26, 2025
@MihaZupan MihaZupan self-assigned this Nov 26, 2025
Copilot AI review requested due to automatic review settings November 26, 2025 21:05
@dotnet-policy-service
Copy link
Contributor

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

Copilot finished reviewing on behalf of MihaZupan November 26, 2025 21:08
Copy link
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

This PR simplifies the CreateHelper method and its call sites in the Uri class by refactoring exception handling and consolidating null checks. The changes maintain behavioral equivalence while improving code clarity and following modern C# patterns.

Key Changes:

  • Removed the ref UriFormatException? e parameter from CreateHelper, moving exception handling entirely within the method
  • Consolidated null checks for uriString into CreateHelper itself, eliminating redundant checks at call sites
  • Modernized the UriKind range validation to use pattern matching syntax

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.

1 participant