Removed branching
This commit is contained in:
@@ -112,6 +112,7 @@ mod tests {
|
||||
let margin = 0.005;
|
||||
|
||||
#[rustfmt::skip]
|
||||
// TODO: More mods
|
||||
let data = vec![
|
||||
(1851299, 1 << 8, 4.23514130038547), // HT
|
||||
(1851299, 0, 5.356786475158158), // NM
|
||||
|
||||
@@ -90,11 +90,7 @@ pub(crate) fn point_at_distance(array: &[Pos2], distance: f32) -> Pos2 {
|
||||
let angle = angle_from_points(array[i], array[i + 1]);
|
||||
let cart = cart_from_pol(distance - current_distance, angle);
|
||||
|
||||
if array[i].x > array[i + 1].x {
|
||||
array[i] - cart
|
||||
} else {
|
||||
array[i] + cart
|
||||
}
|
||||
array[i] + cart * ((array[i].x <= array[i + 1].x) as i8 * 2 - 1) as f32
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![allow(unused)]
|
||||
|
||||
use super::curve::Curve;
|
||||
|
||||
use parse::{Beatmap, BeatmapAttributes, HitObject, HitObjectKind, PathType, Pos2};
|
||||
@@ -315,10 +317,9 @@ impl SliderTick {
|
||||
}
|
||||
}
|
||||
|
||||
use std::fmt;
|
||||
|
||||
impl fmt::Debug for SliderTick {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
// TODO: Remove
|
||||
impl std::fmt::Debug for SliderTick {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
write!(f, "{{pos={:?} | time={}}}", self.pos, self.time)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user