Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
add clear method to Spline
Browse files Browse the repository at this point in the history
  • Loading branch information
fu5ha committed Sep 13, 2023
1 parent e1b7807 commit eca09f1
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 eca09f1

Please sign in to comment.