Skip to content
New issue

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

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

Already on GitHub? # to your account

NewRectFromPoints should not modify its inputs #46

Closed
magnushiie opened this issue Oct 13, 2022 · 2 comments · Fixed by #47
Closed

NewRectFromPoints should not modify its inputs #46

magnushiie opened this issue Oct 13, 2022 · 2 comments · Fixed by #47

Comments

@magnushiie
Copy link
Contributor

magnushiie commented Oct 13, 2022

NewRectFromPoints currently modifies its input slices without any warning in the documentation to the caller.

This can result in hours of troubleshooting, as it only happens if some first coordinate is above the second coordinate.

Also consider using value types (arrays) instead of reference types (slices).

@dhconnelly
Copy link
Owner

Yup, it shouldn't modify the inputs. Happy to accept a PR for this! Using arrays is infeasible though as the library intentionally supports runtime-determined dimensionality.

@dhconnelly
Copy link
Owner

something like this would help for using arrays: golang/go#44253

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

Successfully merging a pull request may close this issue.

2 participants