Skip to content

Commit

Permalink
refactor: remove unnecessary variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Apr 30, 2024
1 parent f99f771 commit 9e64ae2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,7 @@ def _handle_enter(
selected: Cursor,
mode: SingleLineModeImpl,
) -> Todos:
todo = todos[int(selected)] if len(todos) > 0 else Todo()
if todo.has_box():
if len(todos) > 0 and todos[int(selected)].has_box():
return toggle(todos, selected)
return new_todo_next(stdscr, todos, selected, Todo(), mode=mode)

Expand Down

0 comments on commit 9e64ae2

Please sign in to comment.