AA.clear()?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Sat Feb 16 17:37:03 PST 2013


On Sat, 16 Feb 2013 16:58:27 -0800
"H. S. Teoh" <hsteoh at quickfur.ath.cx> wrote:

> On Sat, Feb 16, 2013 at 07:20:29PM -0500, Nick Sabalausky wrote:
> > Didn't there used to be an AA.clear (maybe a different name?) to
> > clear an assoc array? There doesn't appear to be any mention of it
> > here:
> > 
> > http://dlang.org/hash-map
> > 
> > Did something happen to it, or am I just remembering wrong?
> 
> Since AA's are reference types, couldn't you just assign a null AA to
> it?
> 

Yes, but I think that means an additional re-allocation next time
something's added. (Jonathan's answer is probably better though ;) )



More information about the Digitalmars-d-learn mailing list