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:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user