Rename variables to improve clarity, consistency

This commit is contained in:
Hanno Braun 2023-09-29 10:24:47 +02:00
parent e098aced8f
commit 952c2ff845

View File

@ -101,18 +101,18 @@ impl CurveApproxSegment {
); );
assert!(other.is_normalized(), "Can't merge non-normalized segment."); assert!(other.is_normalized(), "Can't merge non-normalized segment.");
let [a_min, a_max] = self.boundary.inner; let [self_min, self_max] = self.boundary.inner;
let [b_min, b_max] = other.boundary.inner; let [other_min, other_max] = other.boundary.inner;
let min = cmp::min(a_min, b_min); let min = cmp::min(self_min, other_min);
let max = cmp::max(a_max, b_max); let max = cmp::max(self_max, other_max);
self.boundary.inner = [min, max]; self.boundary.inner = [min, max];
self.points.retain(|point| { self.points.retain(|point| {
// Only retain points that don't overlap with the other segment, or // Only retain points that don't overlap with the other segment, or
// we might end up with duplicates. // we might end up with duplicates.
point.local_form < b_min || point.local_form > b_max point.local_form < other_min || point.local_form > other_max
}); });
self.points.extend(&other.points); self.points.extend(&other.points);
self.points.sort(); self.points.sort();