hadronized / splines

Interpolation made easy.
https://crates.io/crates/splines
Other
162 stars 31 forks source link

Support for `Spline`s based on `VecDeque` #105

Closed GyulyVGC closed 6 months ago

GyulyVGC commented 7 months ago

Hi guys and thanks for this handy library!

With this issue I'd like to propose supporting Splines based on VecDeque instead of just simple Vec.

This is particularly helpful in case the first key of the spline object needs to be removed efficiently. Right now, to do so one must call remove(0) that has a O(n) complexity.

hadronized commented 7 months ago

Hello!

Yeah, using something more bidirectional is probably a better idea, indeed! I’ll see whenever I have some spare-time to work on that; if anyone else want to make a PR to replace the Vec with a VecDeque, I’m all good with that.