Optimize list appends O(n^2)->O(n)

This commit is contained in:
2022-11-15 23:02:01 -05:00
parent 1595a6310d
commit 41bebd1472
3 changed files with 6 additions and 4 deletions

View File

@@ -116,7 +116,7 @@ struct ucl_object *ucl_list_append(struct ucl_object *list, struct ucl_object *o
if (list->cell.car == NULL) {
list->cell.car = obj;
return NULL;
return list;
}
while (iter->cell.cdr != NULL) {