diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-05-20 14:37:56 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-05-20 14:37:56 -0400 |
commit | bc952b51f48905392cec5685853fbb44565057a8 (patch) | |
tree | 7c133a045684d4bdc4f023ba134f3a37b792dca6 /src/bftw.c | |
parent | f642b3dd1271e4a1503ce7629ba36e25d6a59fce (diff) | |
download | bfs-bc952b51f48905392cec5685853fbb44565057a8.tar.xz |
list: Return the removed item from SLIST_POP()
Diffstat (limited to 'src/bftw.c')
-rw-r--r-- | src/bftw.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -780,8 +780,7 @@ static bool bftw_pop_dir(struct bftw_state *state) { return false; } - state->file = state->dirs.head; - SLIST_POP(&state->dirs); + state->file = SLIST_POP(&state->dirs); return true; } @@ -952,8 +951,7 @@ static void bftw_list_sort(struct bftw_list *list) { // Split for (struct bftw_file *hare = list->head; hare && (hare = hare->next); hare = hare->next) { - struct bftw_file *tortoise = list->head; - SLIST_POP(list); + struct bftw_file *tortoise = SLIST_POP(list); SLIST_APPEND(&left, tortoise); } SLIST_EXTEND(&right, list); |