test(optimize): restore the file around the appended tests

This commit is contained in:
Dylan M. Taylor
2026-11-10 21:36:52 -05:00
parent ba0812fd87
commit fa0c7cb891
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -54,7 +54,9 @@ fn tree_entries(doc: &Document, node: &Object) -> Vec<(Vec<u8>, Object)> {
}
// A kids array shared by reference is read once, and only kids not yet seen are queued:
// nodes sharing one array can't multiply the queue.
if let Some(kids) = d.get(b"Kids").filter(|k| !matches!(k, Object::Ref(r) if !seen.insert(*r))).map(|x| doc.resolve(x)).and_then(|x| x.as_array().cloned()) {
if let Some(kids) =
d.get(b"Kids").filter(|k| !matches!(k, Object::Ref(r) if !seen.insert(*r))).map(|x| doc.resolve(x)).and_then(|x| x.as_array().cloned())
{
queue.extend(kids.into_iter().filter(|k| !matches!(k, Object::Ref(r) if seen.contains(r))).map(|k| (k, depth + 1)));
}
}
+1
View File
@@ -5440,6 +5440,7 @@ fn a_picture_whose_mask_is_not_a_stencil_is_left_alone() {
assert_eq!(report.images_resampled + report.images_recompressed, 0, "{what}: {report:?}");
assert_eq!(stream(&doc, img), before, "{what}");
}
}
/// A resource dictionary shared by reference between thousands of pages is walked once by the
/// space audit, not once per page.