mhyfritz / hilbert-curve

2D Hilbert curve mapping in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pointToIndex mutates the coordinates of the provided point

bjnsn opened this issue · comments

Mutation of the point provided as an argument to pointToIndex causes confusing hard to track bugs. It would be helpful to either document the behavior or make the function pure.

See:
https://github.com/mhyfritz/hilbert-curve/blob/master/src/index.js#L59
https://github.com/mhyfritz/hilbert-curve/blob/master/src/index.js#L69