diff --git a/Cargo.lock b/Cargo.lock index 69c4504ad..541c71ee1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -154,9 +154,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -389,7 +389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap 2.2.1", ] [[package]] @@ -425,7 +425,7 @@ checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0" dependencies = [ "cfg-if", "hashbrown 0.14.3", - "indexmap 2.1.0", + "indexmap 2.2.1", "indoc", "libc", "memoffset", @@ -598,7 +598,7 @@ dependencies = [ "ahash", "fixedbitset", "hashbrown 0.14.3", - "indexmap 2.1.0", + "indexmap 2.2.1", "ndarray", "ndarray-stats", "num-bigint", @@ -624,7 +624,7 @@ dependencies = [ "ahash", "fixedbitset", "hashbrown 0.14.3", - "indexmap 2.1.0", + "indexmap 2.2.1", "num-traits", "petgraph", "priority-queue", diff --git a/src/dag_algo/mod.rs b/src/dag_algo/mod.rs index 1d5ce39da..9bda7aec2 100644 --- a/src/dag_algo/mod.rs +++ b/src/dag_algo/mod.rs @@ -748,12 +748,12 @@ pub fn transitive_reduction( descendants.insert(v, dfs); } for desc in &descendants[&v] { - u_nbrs.remove(&NodeIndex::new(desc.1)); + u_nbrs.swap_remove(&NodeIndex::new(desc.1)); } } *check_count.get_mut(&v).unwrap() -= 1; if check_count[&v] == 0 { - descendants.remove(&v); + descendants.swap_remove(&v); } } for v in u_nbrs { diff --git a/src/digraph.rs b/src/digraph.rs index 1afb1ba98..6e8cb53d5 100644 --- a/src/digraph.rs +++ b/src/digraph.rs @@ -2520,7 +2520,7 @@ impl PyDiGraph { let node_index = self.graph.add_node(obj); // Sanitize new node index from user input. - indices_to_remove.remove(&node_index); + indices_to_remove.swap_remove(&node_index); // Determine edges for new node. let mut incoming_edges: Vec<_> = indices_to_remove diff --git a/src/graph.rs b/src/graph.rs index 0ad81c25b..93c5e033a 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -1825,7 +1825,7 @@ impl PyGraph { let node_index = self.graph.add_node(obj); // Sanitize new node index from user input. - indices_to_remove.remove(&node_index); + indices_to_remove.swap_remove(&node_index); // Determine edges for new node. // note: `edges_directed` returns all edges with `i` as diff --git a/src/steiner_tree.rs b/src/steiner_tree.rs index 4c3fde3ff..c8df908da 100644 --- a/src/steiner_tree.rs +++ b/src/steiner_tree.rs @@ -156,8 +156,8 @@ fn fast_metric_edges( let mut paths = DictMap::with_capacity(graph.graph.node_count()); let mut distance: DictMap = dijkstra(&graph.graph, dummy, None, cost_fn, Some(&mut paths))?; - paths.remove(&dummy); - distance.remove(&dummy); + paths.swap_remove(&dummy); + distance.swap_remove(&dummy); graph.graph.remove_node(dummy); // ``partition[u]`` holds the terminal node closest to node ``u``.