inline SteppedVector::get_index

This commit is contained in:
Simon Gardling 2022-05-23 10:11:59 -04:00
parent a94c0ed3b6
commit be8abfca28

View File

@ -20,6 +20,7 @@ pub struct SteppedVector<'a> {
impl<'a> SteppedVector<'a> { impl<'a> SteppedVector<'a> {
/// Returns `Option<usize>` with index of element with value `x`. and `None` if `x` does not exist in `data` /// Returns `Option<usize>` with index of element with value `x`. and `None` if `x` does not exist in `data`
#[inline]
pub fn get_index(&self, x: f64) -> Option<usize> { pub fn get_index(&self, x: f64) -> Option<usize> {
debug_assert!(!x.is_nan()); debug_assert!(!x.is_nan());
debug_assert!(self.step > 0.0); debug_assert!(self.step > 0.0);