wizapp-stdlib/codegen/dbl_list/snippets/list_get

14 lines
231 B
Plaintext

if (index >= list->node_count) {{
return NULL;
}}
{T}Node *output = NULL;
{T}Node *current = list->first;
for (u64 i = 1; i <= index; ++i) {{
current = current->next;
}}
output = current;
return output;