Having a look at the implementation shows that
CList
nodes are stored in
CPlex
blocks. These blocks are allocated using the block size parameter passed to the
CList constructor[
^].
Using a larger block size value will result in less memory allocations and de-allocations and will therefore reduce the execution time. If the maximum number of items is known in advance, that can be passed to have only one big memory allocation.
However, the
RemoveAll
implementation will still iterate through all nodes which took some time.