dhconnelly/rtreego

NewRectFromPoints should not modify its inputs

magnushiie opened this issue · 2 comments

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).

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.

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