@@ -107,14 +107,11 @@ impl SerializedDepGraph {
107
107
let header = self . edge_list_indices [ source] ;
108
108
let mut raw = & self . edge_list_data [ header. start ( ) ..] ;
109
109
110
- // The number of edges for this node is implicitly stored in the combination of the byte
111
- // width and the length.
112
110
let bytes_per_index = header. bytes_per_index ( ) ;
113
- let len = header. edges ;
114
111
115
112
// LLVM doesn't hoist EdgeHeader::mask so we do it ourselves.
116
113
let mask = header. mask ( ) ;
117
- ( 0 ..len ) . map ( move |_| {
114
+ ( 0 ..header . num_edges ) . map ( move |_| {
118
115
// Doing this slicing in this order ensures that the first bounds check suffices for
119
116
// all the others.
120
117
let index = & raw [ ..DEP_NODE_SIZE ] ;
@@ -157,7 +154,7 @@ impl SerializedDepGraph {
157
154
#[ derive( Debug , Clone , Copy ) ]
158
155
struct EdgeHeader {
159
156
repr : usize ,
160
- edges : u32 ,
157
+ num_edges : u32 ,
161
158
}
162
159
163
160
impl EdgeHeader {
@@ -206,7 +203,7 @@ impl SerializedDepGraph {
206
203
) ;
207
204
let mut fingerprints = IndexVec :: from_elem_n ( Fingerprint :: ZERO , node_count) ;
208
205
let mut edge_list_indices =
209
- IndexVec :: from_elem_n ( EdgeHeader { repr : 0 , edges : 0 } , node_count) ;
206
+ IndexVec :: from_elem_n ( EdgeHeader { repr : 0 , num_edges : 0 } , node_count) ;
210
207
211
208
// This estimation assumes that all of the encoded bytes are for the edge lists or for the
212
209
// fixed-size node headers. But that's not necessarily true; if any edge list has a length
@@ -419,10 +416,10 @@ impl<D: Deps> SerializedNodeHeader<D> {
419
416
}
420
417
421
418
#[ inline]
422
- fn edges_header ( & self , edge_list_data : & [ u8 ] , edges : u32 ) -> EdgeHeader {
419
+ fn edges_header ( & self , edge_list_data : & [ u8 ] , num_edges : u32 ) -> EdgeHeader {
423
420
EdgeHeader {
424
421
repr : ( edge_list_data. len ( ) << DEP_NODE_WIDTH_BITS ) | ( self . bytes_per_index ( ) - 1 ) ,
425
- edges ,
422
+ num_edges ,
426
423
}
427
424
}
428
425
}
0 commit comments