Skip to content

Commit

Permalink
DEV: Remove Ruff rule PLW3301
Browse files Browse the repository at this point in the history
PLW3301: nested-min-max. Nested min and max calls can be flattened into a single call to improve readability.
  • Loading branch information
j-t-1 authored Jan 31, 2025
1 parent 09df735 commit b7bc328
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pypdf/generic/_data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@ def get_next_obj_pos(
for gen in rem_gens:
loc = pdf.xref[gen]
try:
out = min(out, min([x for x in loc.values() if p < x <= p1]))
values = [x for x in loc.values() if p < x <= p1]
if values:
out = min(out, *values)
except ValueError:
pass
return out
Expand Down

0 comments on commit b7bc328

Please sign in to comment.