Memory: restore CloneList() function which was removed in #608

This commit is contained in:
Davide Beatrici committed 2018-08-05 20:08:37 +02:00
1 parent 59e1483dbf
commit 190ad01eb7
2 files changed
+15

No files matched your search

+14
View File
@@ -1326,6 +1326,20 @@ QUEUE *NewQueueFast()
return q;
}
// Clone the list
LIST *CloneList(LIST *o)
{
LIST *n = NewList(o->cmp);
// Memory reallocation
Free(n->p);
n->p = ToArray(o);
n->num_item = n->num_reserved = LIST_NUM(o);
n->sorted = o->sorted;
return n;
}
// Copy the list to an array
void CopyToArray(LIST *o, void *p)
{