Skip to content
Prev Previous commit
Next Next commit
Removed redundant code in python istitle implementation
  • Loading branch information
advikkabra committed Feb 11, 2024
commit 90999bb573224cafa2da487b695327f40fc91372
4 changes: 1 addition & 3 deletions src/runtime/lpython_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,7 @@ def _lpython_str_istitle(s: str) -> bool:
ch: str
only_whitespace: bool = True
for ch in s:
if (ch == ' ' or ch == '\t' or ch == '\n') and word_start:
continue # Found a space character at the start of a word
elif ch.isalpha() and (ord('A') <= ord(ch) and ord(ch) <= ord('Z')):
if ch.isalpha() and (ord('A') <= ord(ch) and ord(ch) <= ord('Z')):
only_whitespace = False
if word_start:
word_start = False
Expand Down