rustc_data_structures::transitive_relation

Function pare_down

Source
fn pare_down(candidates: &mut Vec<usize>, closure: &BitMatrix<usize, usize>)
Expand description

Pare down is used as a step in the LUB computation. It edits the candidates array in place by removing any element j for which there exists an earlier element i<j such that i -> j. That is, after you run pare_down, you know that for all elements that remain in candidates, they cannot reach any of the elements that come after them.

Examples follow. Assume that a -> b -> c and x -> y -> z.

  • Input: [a, b, x]. Output: [a, x].
  • Input: [b, a, x]. Output: [b, a, x].
  • Input: [a, x, b, y]. Output: [a, x].