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

New() initializer panics if the given size is uintptr(0) #42

Closed
chiho20 opened this issue Oct 26, 2023 · 2 comments · Fixed by #44
Closed

New() initializer panics if the given size is uintptr(0) #42

chiho20 opened this issue Oct 26, 2023 · 2 comments · Fixed by #44

Comments

@chiho20
Copy link

chiho20 commented Oct 26, 2023

I wanted to initialize a haxmap B with the same size as haxmap A with the following code:

B := haxmap.New[string, struct{}](A.Len())

which worked for most cases except when A.Len() is 0. When A has 0 key-values, the initializer would panic.

Would be awesome if this is handled 🙏

@alphadose
Copy link
Owner

@chiho20 got it, will make the changes and release new minor version soon 👍

@semihbkgr
Copy link
Contributor

I've created a PR that references this issue: #44

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 a pull request may close this issue.

3 participants