Todo resort() optimization
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
b44307cc83
commit
4777c60056
@ -158,9 +158,7 @@ void todo_delete(struct todo *todo)
|
|||||||
*/
|
*/
|
||||||
void todo_resort(struct todo *t)
|
void todo_resort(struct todo *t)
|
||||||
{
|
{
|
||||||
llist_item_t *i = LLIST_FIND_FIRST(&todolist, t, NULL);
|
LLIST_REORDER(&todolist, t, todo_cmp);
|
||||||
LLIST_REMOVE(&todolist, i);
|
|
||||||
LLIST_ADD_SORTED(&todolist, t, todo_cmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flag a todo item. */
|
/* Flag a todo item. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user