|
|
@ -289,6 +289,26 @@ public: |
|
|
|
|
|
|
|
void collect() |
|
|
|
{ |
|
|
|
auto elems = &elements; |
|
|
|
while(elems->ptr) |
|
|
|
{ |
|
|
|
auto elems_after = &(elems->ptr->next); |
|
|
|
while(elems_after->ptr) |
|
|
|
{ |
|
|
|
if( |
|
|
|
elems->ptr->data.first == elems_after->ptr->data.first |
|
|
|
) |
|
|
|
{ |
|
|
|
*elems_after = std::move(elems_after->ptr->next); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
elems_after = &(elems_after->ptr->next); |
|
|
|
} |
|
|
|
} |
|
|
|
elems = &(elems->ptr->next); |
|
|
|
} |
|
|
|
|
|
|
|
auto cps = &copies; |
|
|
|
while(cps->ptr) |
|
|
|
{ |
|
|
|