Skip to content

[CoreGraphics] CGFloat: Implement better hashing #20873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 29, 2018

Conversation

lorentey
Copy link
Member

(This PR was originally part of #20685.)

SE-0206 deprecated hashValue as a Hashable requirement, replacing it with hash(into:). This PR adds a direct implementation of CGFloat.hash(into:) and CGFloat._rawHashValue(seed:), modernizing its hashing and bringing it to the same performance as that of Float and Double.

rdar://problem/43394032

This replaces the previously compiler-synthesized implementation with one that directly feeds the wrapped value to the hasher. The new definition is functionally equivalent, but warning-free and faster.
This makes for a small speedup, bringing CGFloat hashing to the same speed as direct Float/Double.
@lorentey
Copy link
Member Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b58d3d1

@lorentey
Copy link
Member Author

Linux failure is unrelated -- re-running smoke tests for it.

@swift-ci smoke test linux platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants