about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorIsaac Whitfield <iw@whitfin.io>2018-05-09 23:36:57 -0700
committerIsaac Whitfield <iw@whitfin.io>2018-05-09 23:36:57 -0700
commitae3feff0281b2f08f6dbb75dc2e50e338a711e5f (patch)
treeb8184c26f58785571efa51fc3e357818a51cdd82 /src
parent8ff4b42064b374bb62043f7729f84b6d979c7667 (diff)
downloadrust-ae3feff0281b2f08f6dbb75dc2e50e338a711e5f.tar.gz
rust-ae3feff0281b2f08f6dbb75dc2e50e338a711e5f.zip
Remove unnecessary mutable borrow and resizing
Diffstat (limited to 'src')
-rw-r--r--src/librustc/dep_graph/graph.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs
index 22ab1b15c8b..b26281ad7eb 100644
--- a/src/librustc/dep_graph/graph.rs
+++ b/src/librustc/dep_graph/graph.rs
@@ -534,15 +534,9 @@ impl DepGraph {
     }
 
     pub fn serialize(&self) -> SerializedDepGraph {
-        let mut fingerprints = self.fingerprints.borrow_mut();
         let current_dep_graph = self.data.as_ref().unwrap().current.borrow();
 
-        // Make sure we don't run out of bounds below.
-        if current_dep_graph.nodes.len() > fingerprints.len() {
-            fingerprints.resize(current_dep_graph.nodes.len(), Fingerprint::ZERO);
-        }
-
-        let fingerprints = fingerprints.clone().convert_index_type();
+        let fingerprints = self.fingerprints.borrow().clone().convert_index_type();
         let nodes = current_dep_graph.nodes.clone().convert_index_type();
 
         let total_edge_count: usize = current_dep_graph.edges.iter()