diff --git a/src/spline.rs b/src/spline.rs index 8d065eb..242eca6 100644 --- a/src/spline.rs +++ b/src/spline.rs @@ -55,6 +55,13 @@ impl Spline { spline.internal_sort(); spline } + + /// Clear the spline by removing all keys. Keeps the underlying allocated storage, so adding + /// new keys should be faster than creating a new [`Spline`] + #[inline] + pub fn clear(&mut self) { + self.0.clear() + } /// Create a new spline by consuming an `Iterater>`. They keys don’t have to be /// sorted.