Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions jingle/src/analysis/cfg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,14 @@ impl<N: CfgState, D: ModelTransition<N::Model>> PcodeCfg<N, D> {
///
/// If the resulting subgraph has more than one connected component (treating edges as undirected
/// for connectivity), this function will panic.
pub fn sub_cfg_from_indices(&self, selected: &HashSet<NodeIndex>) -> PcodeCfg<N, D> {
pub fn sub_cfg_from_indices<I: Iterator<Item = NodeIndex>>(
&self,
selected: I,
) -> PcodeCfg<N, D> {
// Build the set of NodeIndex that we will include: exactly the selected nodes.
// Do NOT include outgoing neighbors or nodes that only have incoming edges into the selected set.
let mut include: HashSet<NodeIndex> = HashSet::new();
for &idx in selected {
for idx in selected {
include.insert(idx);
}

Expand Down