Skip to content

Commit d179f4f

Browse files
committed
fix initial duplication set
1 parent 7277448 commit d179f4f

File tree

1 file changed

+9
-2
lines changed
  • turbopack/crates/turbo-persistence/src/compaction

1 file changed

+9
-2
lines changed

turbopack/crates/turbo-persistence/src/compaction/selector.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)