Skip to content

Rm goto in HashCode Add byte span#129955

Closed
michaelnathanroberts wants to merge 1 commit into
dotnet:mainfrom
michaelnathanroberts:main
Closed

Rm goto in HashCode Add byte span#129955
michaelnathanroberts wants to merge 1 commit into
dotnet:mainfrom
michaelnathanroberts:main

Conversation

@michaelnathanroberts

Copy link
Copy Markdown

Removed a goto in HashCode.cs and added a private function to avoid a bulky if statement and the goto antipatterns.

@github-actions github-actions Bot added the area-codeflow for labeling automated codeflow label Jun 29, 2026
@dotnet-policy-service dotnet-policy-service Bot added linkable-framework Issues associated with delivering a linker friendly framework community-contribution Indicates that the PR has been added by a community member labels Jun 29, 2026
@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

@michaelnathanroberts This is a very odd change given the amount of reviewers and the description. I'm going to close this for now as reviewing this particular PR doesn't seem appropriate. If you'd like to submit a new one, please make it much more targeted and perhaps have additional details on what make the change beneficial in a measurable manner.

@michaelnathanroberts

Copy link
Copy Markdown
Author

Hi @AaronRobinsonMSFT, I removed a goto in the Add function of System.HashCode. It is purely stylistic because gotos are generally considered an anti-pattern (see Djikstra's GOTO considered harmful). Please advise what other information I should include and who should I ask to review it?

@huoyaoyuan

Copy link
Copy Markdown
Member

The PR contains many unrelated file permission and other changes. Please ensure you are using Git properly.

It is purely stylistic because gotos are generally considered an anti-pattern (see Djikstra's GOTO considered harmful).

This is not true. Goto is harmful when abused. It's necessary for advanced performance optimization. System.HashCode is a fundamental component and applicable for advanced optimization.

This PR will not be acceptable given its motivation.

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

Labels

area-codeflow for labeling automated codeflow community-contribution Indicates that the PR has been added by a community member linkable-framework Issues associated with delivering a linker friendly framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants