Skip to content

Commit

Permalink
add TODO tag
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Sep 9, 2024
1 parent ace9264 commit 9e92bb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/monty/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ def reverse_readfile(
# Find line segment start and end positions
seg_start_pos = filemap.rfind(l_end.encode(), 0, file_size)
sec_end_pos = file_size - len(l_end) + 1
# TODO: -len(l_end) and then + l_end looks silly,
# but otherwise get "\r\r" at the end of each line

# The first line doesn't have an ending character at its head
# The first line doesn't have an ending character at its start
if seg_start_pos == -1:
yield (filemap[:sec_end_pos].decode("utf-8") + l_end)

Expand Down

0 comments on commit 9e92bb9

Please sign in to comment.