Skip to content

Commit

Permalink
STY: Refactor skip_over_whitespace (py-pdf#2946)
Browse files Browse the repository at this point in the history
Small change that increases readability and is more consistent with read_non_whitespace.
  • Loading branch information
j-t-1 authored Nov 15, 2024
1 parent 65f4680 commit 4dfea91
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pypdf/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ def skip_over_whitespace(stream: StreamType) -> bool:
stream: The data stream from which was read.
Returns:
True if more than one whitespace was skipped, otherwise return False.
True if one or more whitespace was skipped, otherwise return False.
"""
tok = WHITESPACES[0]
tok = stream.read(1)
cnt = 0
while tok in WHITESPACES:
tok = stream.read(1)
cnt += 1
return cnt > 1
tok = stream.read(1)
return cnt > 0


def check_if_whitespace_only(value: bytes) -> bool:
Expand Down

0 comments on commit 4dfea91

Please sign in to comment.