File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
turbopack/crates/turbo-persistence/src/compaction Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -233,13 +233,20 @@ pub fn get_merge_segments<T: Compactable>(
233233 // We have reached the maximum number of merge jobs, so we stop here.
234234 break ;
235235 }
236- let mut current_range = start_compactable. range ( ) ;
236+ let start_compactable_range = start_compactable. range ( ) ;
237+ let start_compactable_size = start_compactable. size ( ) ;
238+ let mut current_range = start_compactable_range. clone ( ) ;
237239
238240 // We might need to restart the search if we need to extend the range.
239241 ' search: loop {
240242 let mut current_set = smallvec ! [ start_index] ;
241- let mut current_size = start_compactable . size ( ) ;
243+ let mut current_size = start_compactable_size ;
242244 let mut duplication = IntervalMap :: < Option < DuplicationInfo > > :: new ( ) ;
245+ duplication. update ( start_compactable_range. clone ( ) , |dup_info| {
246+ dup_info
247+ . get_or_insert_default ( )
248+ . add ( start_compactable_size, & start_compactable_range) ;
249+ } ) ;
243250 let mut current_skip = 0 ;
244251
245252 // We will capture compactables in the current_range until we find a optimal merge
You can’t perform that action at this time.
0 commit comments