Integration: #2220 look up set-aside object numbers in a set

fill_xref_gaps scanned every xref oddity for each object header; a file with many offset-0 rows and many headers took quadratic time.
This commit is contained in:
aiongg
2026-10-22 01:46:03 +00:00
parent 57283a52fe
commit 79d843524c
+2 -1
View File
@@ -1968,9 +1968,10 @@ impl Document {
} else {
HashSet::new()
};
let odd: HashSet<u32> = self.xref_oddities.iter().map(|(_, n)| *n).collect();
let mut found = 0usize;
for (&num, &(offset, generation)) in &located {
let left_out = past_shift.contains(&num) || self.xref_oddities.iter().any(|(_, n)| *n == num);
let left_out = past_shift.contains(&num) || odd.contains(&num);
if num != 0 && !filled.contains_key(&num) && left_out {
filled.insert(num, XrefEntry::InFile { offset, generation });
found += 1;