mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
Fix Dominators::rank_partial_cmp to match documentation
The only use site is also updated accordingly and there is no change in end-to-end behaviour.
This commit is contained in:
parent
1f72129ffe
commit
b8c5821ad8
@ -299,7 +299,7 @@ impl<Node: Idx> Dominators<Node> {
|
|||||||
/// of two unrelated nodes will also be consistent, but otherwise the order has no
|
/// of two unrelated nodes will also be consistent, but otherwise the order has no
|
||||||
/// meaning.) This method cannot be used to determine if either Node dominates the other.
|
/// meaning.) This method cannot be used to determine if either Node dominates the other.
|
||||||
pub fn rank_partial_cmp(&self, lhs: Node, rhs: Node) -> Option<Ordering> {
|
pub fn rank_partial_cmp(&self, lhs: Node, rhs: Node) -> Option<Ordering> {
|
||||||
self.post_order_rank[lhs].partial_cmp(&self.post_order_rank[rhs])
|
self.post_order_rank[rhs].partial_cmp(&self.post_order_rank[lhs])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,11 +341,11 @@ impl<'a, 'tcx> CoverageSpans<'a, 'tcx> {
|
|||||||
if a.is_in_same_bcb(b) {
|
if a.is_in_same_bcb(b) {
|
||||||
Some(Ordering::Equal)
|
Some(Ordering::Equal)
|
||||||
} else {
|
} else {
|
||||||
// Sort equal spans by dominator relationship, in reverse order (so
|
// Sort equal spans by dominator relationship (so dominators always come
|
||||||
// dominators always come after the dominated equal spans). When later
|
// before the dominated equal spans). When later comparing two spans in
|
||||||
// comparing two spans in order, the first will either dominate the second,
|
// order, the first will either dominate the second, or they will have no
|
||||||
// or they will have no dominator relationship.
|
// dominator relationship.
|
||||||
self.basic_coverage_blocks.dominators().rank_partial_cmp(b.bcb, a.bcb)
|
self.basic_coverage_blocks.dominators().rank_partial_cmp(a.bcb, b.bcb)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Sort hi() in reverse order so shorter spans are attempted after longer spans.
|
// Sort hi() in reverse order so shorter spans are attempted after longer spans.
|
||||||
|
Loading…
Reference in New Issue
Block a user