Skip to content

Commit

Permalink
Merge pull request #195 from wjayee/feature/fixReset
Browse files Browse the repository at this point in the history
Fix reset command to reset duplicate tasks
  • Loading branch information
bkjwjason committed Nov 11, 2023
2 parents e0e4ab5 + 459e834 commit 0148eb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/seedu/address/model/animal/TaskList.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ public TaskList updateTaskList(int[] indexes, boolean isDone) throws IndexOutOfB
* @return The number of tasks in the taskList.
*/
public TaskList resetTasks() {
int[] index = new int[1];
taskList.forEach(task -> {
int index = taskList.indexOf(task);
Task updatedTask = task.updateTask(false);
taskList.set(index, updatedTask);
taskList.set(index[0], updatedTask);
index[0]++;
});

return this;
Expand Down

0 comments on commit 0148eb9

Please sign in to comment.