Remove some unhelpful lambdas
This commit is contained in:
@@ -179,7 +179,8 @@ def _traverse_toc(pdf_base, visitor_fn, log):
|
||||
if objgen not in visited:
|
||||
queue.add(objgen)
|
||||
|
||||
visitor_fn(pdf_base, node, log)
|
||||
if visitor_fn:
|
||||
visitor_fn(pdf_base, node, log)
|
||||
|
||||
|
||||
def _fix_toc(pdf_base, pageref_remap, log):
|
||||
@@ -282,7 +283,7 @@ def weave_layers(
|
||||
# page references in the table of contents. Some PDF generators put invalid
|
||||
# references in the ToC, so we want to resolve them to null before we
|
||||
# create any references, or the ToC will be corrupted
|
||||
_traverse_toc(pdf_base, lambda *args: None, log)
|
||||
_traverse_toc(pdf_base, None, log)
|
||||
|
||||
procset = pdf_base.make_indirect(
|
||||
pikepdf.Object.parse(b'[ /PDF /Text /ImageB /ImageC /ImageI ]'))
|
||||
|
||||
@@ -130,7 +130,7 @@ def extract_image(*, pike, root, log, image, xref, jbig2s,
|
||||
def extract_images(pike, root, log, options):
|
||||
# Extract images we can improve
|
||||
changed_xrefs = set()
|
||||
jbig2_groups = defaultdict(lambda: [])
|
||||
jbig2_groups = defaultdict(list)
|
||||
jpegs = []
|
||||
pngs = []
|
||||
errors = 0
|
||||
|
||||
Reference in New Issue
Block a user