Skip to content
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

hash_map.zig: Pass self by value and less pointer-int conversion #1

Closed
wants to merge 1 commit into from

Conversation

SeanTheGleaming
Copy link
Owner

With this, the only remaining instance of pointer-int conversion in hash_map.zig is in HashMapUnmanaged.removeByPtr, which easily be able to be eliminated once pointer subtraction is supported.

 - Used `Self` instead of `*const Self` where appropriate (orignally proposed in ziglang#19770)
 - Replaced `@intFromPtr` and `@ptrFromInt` with `@ptrCast`, `@alignCast`, and pointer arithmetic where appropriate

With this, the only remaining instance on pointer-int conversion in hash_map.zig is in `HashMapUnmanaged.removeByPtr`, which easily be able to be eliminated once pointer subtraction is supported.
@SeanTheGleaming
Copy link
Owner Author

That's my own fork, haha

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