Skip to content

Commit

Permalink
Merge pull request #98 from EmbarkStudios/master
Browse files Browse the repository at this point in the history
Add `clear` method to `Spline`
  • Loading branch information
hadronized committed Sep 23, 2023
2 parents e7a9723 + eca09f1 commit 2179c83
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/spline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 don’t have to be
/// sorted.
Expand Down

0 comments on commit 2179c83

Please sign in to comment.