Function rustc_data_structures::graph::vec_graph::create_index

source ยท
fn create_index<N: Idx + Ord>(
    num_nodes: usize,
    sorted_edge_sources: &mut dyn Iterator<Item = N>,
    associated_edge_targets: &mut dyn Iterator<Item = N>,
    edge_targets: &mut Vec<N>,
    node_starts: &mut IndexVec<N, usize>,
)
Expand description

Creates/initializes the index for the VecGraph. A helper for VecGraph::new.

  • num_nodes is the target number of nodes in the graph
  • sorted_edge_sources are the edge sources, sorted
  • associated_edge_targets are the edge targets in the same order as sources
  • edge_targets is the vec of targets to be extended
  • node_starts is the index to be filled