[Issue 10009] foreach_reverse and AA.byKey/byValue
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Sep 25 17:11:35 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=10009
Ketmar Dark <ketmar at ketmar.no-ip.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ketmar at ketmar.no-ip.org
--- Comment #19 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
(In reply to yebblies from comment #14)
> I'd love for the built-in AAs to use a linked hash map and guarantee
> iteration in insertion order...
but you can implement your own AAs that does exactly this. built-in AAs aren't
*that* special, just some sugar here and there, plus some D code in druntime.
actually, retaining insertion order will not be *that* slow, but you'll need
two more pointers for each inserted element. this will even make some use cases
faster (aa.byKey.first, for example, which is awfully slow now).
yet i'm not sure that everyone are ready to pay 8/64 bytes per AA element for
this feature.
--
More information about the Digitalmars-d-bugs
mailing list