Skip to content

Commit

Permalink
STY: Refactor check_if_whitespace_only (#2950)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-t-1 authored Nov 18, 2024
1 parent de5d115 commit 5587414
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pypdf/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,7 @@ def check_if_whitespace_only(value: bytes) -> bool:
True if the value only has whitespace characters, otherwise return False.
"""
for index in range(len(value)):
current = value[index : index + 1]
if current not in WHITESPACES:
return False
return True
return all(b in WHITESPACES_AS_BYTES for b in value)


def skip_over_comment(stream: StreamType) -> None:
Expand Down

0 comments on commit 5587414

Please sign in to comment.