Skip to content

Commit

Permalink
Refactor "True if condition else False"
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Oct 8, 2014
1 parent e2fb63c commit 5b61d68
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions chess/pgn.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,7 @@ def scan_offsets(handle):
if not in_comment and line.startswith("[Event \""):
yield last_pos
elif (not in_comment and "{" in line) or (in_comment and "}" in line):
if line.rfind("{") < line.rfind("}"):
in_comment = False
else:
in_comment = True
in_comment = line.rfind("{") > line.rfind("}")

last_pos = handle.tell()
line = handle.readline()

0 comments on commit 5b61d68

Please sign in to comment.