Skip to content

Conversation

@stephentoub
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings July 4, 2025 01:34
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 replaces the manual digit-by-digit formatting of the IPv6 scope ID with a call to uint.TryFormat, removing the TODO and reducing code complexity.

  • Added a Debug.Assert to ensure TChar is either byte or char.
  • Replaced manual stackalloc formatting with a single TryFormat call for both byte and char.
  • Removed the old loop-based formatting and related TODO comment.
Comments suppressed due to low confidence (1)

src/libraries/System.Net.Primitives/src/System/Net/IPAddressParser.cs:225

  • Add unit tests covering the new TryFormat logic for both TChar = char and TChar = byte to ensure the IPv6 scope ID formatting is exercised in all scenarios.
                bool formatted = typeof(TChar) == typeof(byte) ?

@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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants