Optimize list appends O(n^2)->O(n)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user