Skip to content

Commit

Permalink
refactor: prefer reusing list_push_front_node
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiDood committed Sep 23, 2024
1 parent 0cce6ef commit 4c99207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/singly.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ struct List list_split_nth(struct List * const self, const size_t n) {
struct Node * const node = node_get_nth_in_chain(self->head, n);
struct List list = list_create();
if (node != NULL) {
list.head = node->next;
list_push_front_node(&list, node->next);
node->next = NULL; // break connection
}
return list;
Expand Down

0 comments on commit 4c99207

Please sign in to comment.