(points: &[[f64; 2]], seg_idx: &mut usize, x: f64)
| 1052 | }) |
| 1053 | .collect() |
| 1054 | } |
| 1055 | |
| 1056 | /// Keep only strictly increasing-x points in their original order. |
| 1057 | /// |
| 1058 | /// This avoids sorting and lets fill interpolation run in linear time. |
| 1059 | /// Out-of-order (or duplicate-x) points are skipped. |
| 1060 | fn monotonic_increasing_x(points: Vec<[f64; 2]>) -> Vec<[f64; 2]> { |
| 1061 | let mut out = Vec::with_capacity(points.len()); |
| 1062 | let mut last_x: Option<f64> = None; |
no outgoing calls
no test coverage detected