Skip to content

Commit

Permalink
comment on the graph nodes iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Dec 10, 2024
1 parent 708243a commit 4935d97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hugr-core/src/hugr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ impl Hugr {
//
// This is not something we want to expose it the API, so we manually
// iterate instead of writing it as a method.
//
// Since we don't have a non-borrowing iterator over all the possible
// NodeIds, we have to simulate it by iterating over all possible
// indices and checking if the node exists.
for n in 0..self.graph.node_capacity() {
let pg_node = portgraph::NodeIndex::new(n);
let node: Node = pg_node.into();
Expand Down

0 comments on commit 4935d97

Please sign in to comment.