mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-24 10:08:00 -06:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user