Skip to content

Commit

Permalink
renaming new param in slist_insert_node to newNode
Browse files Browse the repository at this point in the history
  • Loading branch information
dmercer-google committed Jan 9, 2024
1 parent 9fb3e42 commit ed8d17e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/utils/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int slist_pop(slist_t *list, snode_t *after, snode_t **node);
int slist_popleft(slist_t *list, snode_t **node);

int slist_remove_node(slist_t *list, snode_t *node);
void slist_insert_node(slist_t *list, snode_t *after, snode_t *new);
void slist_insert_node(slist_t *list, snode_t *after, snode_t *newNode);

#ifdef __cplusplus
}
Expand Down
10 changes: 5 additions & 5 deletions src/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ int slist_remove_node(slist_t *list, snode_t *node)
return 0;
}

void slist_insert_node(slist_t *list, snode_t *after, snode_t *new)
void slist_insert_node(slist_t *list, snode_t *after, snode_t *newNode)
{
if (after == NULL) {
/* same as append left */
new->next = list->head;
list->head = new;
newNode->next = list->head;
list->head = newNode;
} else {
/* assert after in list here? */
new->next = after->next;
after->next = new;
newNode->next = after->next;
after->next = newNode;
}
}

0 comments on commit ed8d17e

Please sign in to comment.