Skip to content

Conversation

@stephentoub
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings January 5, 2026 19:10
@dotnet-policy-service
Copy link
Contributor

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

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 pull request optimizes the HashtableExtensions.TryGetValue method by eliminating a double lookup and specializing the generic method to work specifically with int values.

Key Changes

  • Replaced the generic TryGetValue<T> method with a non-generic version that returns int values
  • Changed the implementation from ContainsKey() + indexer (two lookups) to a single indexer access with pattern matching
  • Changed the default return value from default to explicit 0

@stephentoub stephentoub enabled auto-merge (squash) January 5, 2026 20:54
@stephentoub stephentoub merged commit 178bc48 into dotnet:main Jan 5, 2026
90 of 94 checks passed
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.

2 participants