coverage: Simplify sorting of coverage spans extracted from MIR

Switching to `Ordering::then_with` makes control-flow less complicated, and
there is no need to use `partial_cmp` here.
This commit is contained in:
Zalathar 2023-09-17 14:21:19 +10:00
parent a4cb31bb58
commit 01b67f4b26
3 changed files with 19 additions and 36 deletions

View file

@ -199,12 +199,8 @@ impl CoverageGraph {
}
#[inline(always)]
pub fn rank_partial_cmp(
&self,
a: BasicCoverageBlock,
b: BasicCoverageBlock,
) -> Option<Ordering> {
self.dominators.as_ref().unwrap().rank_partial_cmp(a, b)
pub fn cmp_in_dominator_order(&self, a: BasicCoverageBlock, b: BasicCoverageBlock) -> Ordering {
self.dominators.as_ref().unwrap().cmp_in_dominator_order(a, b)
}
}