Use asserts in dbl_list
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
if (!list) {{
|
||||
return;
|
||||
}}
|
||||
assert(list != NULL);
|
||||
|
||||
u64 count = list->node_count;
|
||||
for (u64 i = 0; i < count; ++i) {{
|
||||
|
@@ -1,6 +1,4 @@
|
||||
if (index >= list->node_count) {{
|
||||
return NULL;
|
||||
}}
|
||||
assert(index < list->node_count);
|
||||
|
||||
{NodeType} *output = NULL;
|
||||
{NodeType} *current = list->first;
|
||||
|
@@ -1,6 +1,4 @@
|
||||
if (!list || !node || !(node->item)) {{
|
||||
return;
|
||||
}}
|
||||
assert(list != NULL && node != NULL && (node->item) != NULL);
|
||||
|
||||
if (index == 0) {{
|
||||
wapp_{Tlower}_list_push_front(list, node);
|
||||
|
@@ -1,6 +1,8 @@
|
||||
assert(list != NULL);
|
||||
|
||||
{NodeType} *output = NULL;
|
||||
|
||||
if (!list || list->node_count == 0) {{
|
||||
if (list->node_count == 0) {{
|
||||
goto RETURN_{Tupper}_LIST_POP_BACK;
|
||||
}}
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
assert(list != NULL);
|
||||
|
||||
{NodeType} *output = NULL;
|
||||
|
||||
if (!list || list->node_count == 0) {{
|
||||
if (list->node_count == 0) {{
|
||||
goto RETURN_{Tupper}_LIST_POP_FRONT;
|
||||
}}
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
if (!list || !node || !(node->item)) {{
|
||||
return;
|
||||
}}
|
||||
assert(list != NULL && node != NULL && (node->item) != NULL);
|
||||
|
||||
{ListType} node_list = {Tlower}_node_to_list(node);
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
if (!list || !node || !(node->item)) {{
|
||||
return;
|
||||
}}
|
||||
assert(list != NULL && node != NULL && (node->item) != NULL);
|
||||
|
||||
{ListType} node_list = {Tlower}_node_to_list(node);
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
assert(list != NULL);
|
||||
|
||||
{NodeType} *output = NULL;
|
||||
if (!list) {{
|
||||
goto RETURN_{Tupper}_LIST_REMOVE;
|
||||
}}
|
||||
|
||||
if (index == 0) {{
|
||||
output = wapp_{Tlower}_list_pop_front(list);
|
||||
|
Reference in New Issue
Block a user