aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2021-01-20 23:47:42 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2021-01-31 09:55:44 -0500
commit4777c60056e42d985cff4e48beb06cdb4cd9b83f (patch)
tree47ff071996c7bcfe341972e0e0a86b7ce78d70d2
parentb44307cc83c730618bec85e91bab490d11f8dc64 (diff)
downloadcalcurse-4777c60056e42d985cff4e48beb06cdb4cd9b83f.tar.gz
calcurse-4777c60056e42d985cff4e48beb06cdb4cd9b83f.zip
Todo resort() optimization
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/todo.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/todo.c b/src/todo.c
index aa77b15..932e02a 100644
--- a/src/todo.c
+++ b/src/todo.c
@@ -158,9 +158,7 @@ void todo_delete(struct todo *todo)
*/
void todo_resort(struct todo *t)
{
- llist_item_t *i = LLIST_FIND_FIRST(&todolist, t, NULL);
- LLIST_REMOVE(&todolist, i);
- LLIST_ADD_SORTED(&todolist, t, todo_cmp);
+ LLIST_REORDER(&todolist, t, todo_cmp);
}
/* Flag a todo item. */