add clear method to Spline

This commit is contained in:
Gray Olson 2023-09-13 15:52:43 +02:00
parent e1b78070c6
commit eca09f1baf

View File

@ -55,6 +55,13 @@ impl<T, V> Spline<T, V> {
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<Item = Key<T>>`. They keys dont have to be
/// sorted.