Optimize the compare of the task lines

This commit is contained in:
Brett Walker 2019-02-07 14:51:11 -06:00
parent 82423ac34a
commit 01835ef048
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class TaskListToggleService
markdown_task = source_lines[source_line_index]
# The source in the DB could be using either \n or \r\n line endings
return unless markdown_task == line_source || markdown_task == line_source + "\r"
return unless markdown_task.chomp == line_source
return unless source_checkbox = Taskable::ITEM_PATTERN.match(markdown_task)
currently_checked = TaskList::Item.new(source_checkbox[1]).complete?