Skip to content

Commit ae3feff

Browse files
committed
Remove unnecessary mutable borrow and resizing
1 parent 8ff4b42 commit ae3feff

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Diff for: src/librustc/dep_graph/graph.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -534,15 +534,9 @@ impl DepGraph {
534534
}
535535

536536
pub fn serialize(&self) -> SerializedDepGraph {
537-
let mut fingerprints = self.fingerprints.borrow_mut();
538537
let current_dep_graph = self.data.as_ref().unwrap().current.borrow();
539538

540-
// Make sure we don't run out of bounds below.
541-
if current_dep_graph.nodes.len() > fingerprints.len() {
542-
fingerprints.resize(current_dep_graph.nodes.len(), Fingerprint::ZERO);
543-
}
544-
545-
let fingerprints = fingerprints.clone().convert_index_type();
539+
let fingerprints = self.fingerprints.borrow().clone().convert_index_type();
546540
let nodes = current_dep_graph.nodes.clone().convert_index_type();
547541

548542
let total_edge_count: usize = current_dep_graph.edges.iter()

0 commit comments

Comments
 (0)