mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-11 03:44:41 +00:00
test(optimize): restore the file around the appended tests
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user