add clear method to Spline
This commit is contained in:
parent
e1b78070c6
commit
eca09f1baf
@ -55,6 +55,13 @@ impl<T, V> Spline<T, V> {
|
|||||||
spline.internal_sort();
|
spline.internal_sort();
|
||||||
spline
|
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 don’t have to be
|
/// Create a new spline by consuming an `Iterater<Item = Key<T>>`. They keys don’t have to be
|
||||||
/// sorted.
|
/// sorted.
|
||||||
|
Loading…
Reference in New Issue
Block a user