File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
compiler/rustc_query_system/src/dep_graph Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -200,16 +200,13 @@ impl SerializedDepGraph {
200200
201201 let graph_bytes = d. len ( ) - ( 2 * IntEncodedWithFixedSize :: ENCODED_SIZE ) - d. position ( ) ;
202202
203- let mut nodes: IndexVec < SerializedDepNodeIndex , _ > = ( 0 ..node_count)
204- . map ( |_| DepNode {
205- kind : D :: DEP_KIND_NULL ,
206- hash : PackedFingerprint :: from ( Fingerprint :: ZERO ) ,
207- } )
208- . collect ( ) ;
209- let mut fingerprints: IndexVec < SerializedDepNodeIndex , _ > =
210- ( 0 ..node_count) . map ( |_| Fingerprint :: ZERO ) . collect ( ) ;
211- let mut edge_list_indices: IndexVec < SerializedDepNodeIndex , _ > =
212- ( 0 ..node_count) . map ( |_| EdgeHeader { repr : 0 , edges : 0 } ) . collect ( ) ;
203+ let mut nodes = IndexVec :: from_elem_n (
204+ DepNode { kind : D :: DEP_KIND_NULL , hash : PackedFingerprint :: from ( Fingerprint :: ZERO ) } ,
205+ node_count,
206+ ) ;
207+ let mut fingerprints = IndexVec :: from_elem_n ( Fingerprint :: ZERO , node_count) ;
208+ let mut edge_list_indices =
209+ IndexVec :: from_elem_n ( EdgeHeader { repr : 0 , edges : 0 } , node_count) ;
213210
214211 // This estimation assumes that all of the encoded bytes are for the edge lists or for the
215212 // fixed-size node headers. But that's not necessarily true; if any edge list has a length
You can’t perform that action at this time.
0 commit comments