Skip to content

Commit

Permalink
STY: Use generator expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
j-t-1 authored Dec 26, 2024
1 parent ccdd2e5 commit 03bf8cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pypdf/_doc_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def indexed_key(k: str, fields: Dict[Any, Any]) -> str:
return (
k
+ "."
+ str(sum([1 for kk in fields if kk.startswith(k + ".")]) + 2)
+ str(sum(1 for kk in fields if kk.startswith(k + ".")) + 2)
)

# Retrieve document form fields
Expand Down
2 changes: 1 addition & 1 deletion pypdf/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ def add_form_topname(self, name: str) -> Optional[DictionaryObject]:
interim[NameObject("/Kids")] = acroform[NameObject("/Fields")]
self.cache_indirect_object(
0,
max([i for (g, i) in self.resolved_objects if g == 0]) + 1,
max(i for (g, i) in self.resolved_objects if g == 0) + 1,
interim,
)
arr = ArrayObject()
Expand Down

0 comments on commit 03bf8cd

Please sign in to comment.