Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[internal] Clarify graph edge removal (pantsbuild#13975)
The docs guarantee the behavior of `remove_edge`, and so we can safely remove edges in reverse order without creating and consuming an `Edges` iterator for each removal. AFAICT, this will be vaguely cheaper (since `impl Iterator for Edges` [is non-trivial](https://docs.rs/petgraph/0.5.1/src/petgraph/graph_impl/mod.rs.html#1611)), but only in terms of constant factors. The total runtime of edge removal is still significant because `remove_edge` itself is `O(e)`, where `e` is the number of edges connected to four different nodes. But in the end, the primary advantage of this change is making the comment less vague. [ci skip-build-wheels]
- Loading branch information