File tree Expand file tree Collapse file tree
webgraph/src/graphs/bvgraph Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,7 +241,6 @@ impl<D: Decode> NodeLabels<D> {
241241 /// Get the successors of the next node in the stream
242242 pub fn next_successors ( & mut self ) -> Result < & [ usize ] > {
243243 let mut res = self . backrefs . take ( self . current_node ) ;
244- res. clear ( ) ;
245244 self . get_successors_iter_priv ( self . current_node , & mut res) ?;
246245 let res = self . backrefs . replace ( self . current_node , res) ;
247246 self . current_node += 1 ;
@@ -256,8 +255,9 @@ impl<D: Decode> NodeLabels<D> {
256255 return Ok ( ( ) ) ;
257256 }
258257
258+ results. clear ( ) ;
259259 // ensure that we have enough capacity in the vector for not reallocating
260- results. reserve ( degree. saturating_sub ( results . capacity ( ) ) ) ;
260+ results. reserve ( degree) ;
261261 // read the reference offset
262262 let ref_delta = if self . compression_window != 0 {
263263 self . decoder . read_reference_offset ( ) as usize
You can’t perform that action at this time.
0 commit comments