How to remove all items in an associative array?

Matti Niemenmaa see_signature at for.real.address
Thu Oct 18 22:53:39 PDT 2007


Gregor Richards wrote:
> Unless the performance is a huge hit, it would probably be wiser to use
> code that isn't dependent on the current implementation of AAs:
> 
> foreach (k; aa.keys.dup) {
>     aa.remove(k);
> }

I believe aa.keys is a duplicate already, meaning there is no need for the .dup.

-- 
E-mail address: matti.niemenmaa+news, domain is iki (DOT) fi



More information about the Digitalmars-d mailing list