1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-06 07:44:57 +03:00

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

This commit is contained in:
Davide Beatrici
2018-08-05 17:26:37 +02:00
parent 59e1483dbf
commit 190ad01eb7
2 changed files with 15 additions and 0 deletions

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)
{