ketmar:
But I think the "j = x.byKey.front; p = x.byValue.front;"
code looks sufficiently idiomatic, and its performance is
terrible.
that's why i suggest to extend AA API, adding x.firstKey and
x.firstValue functions. i'll try to make the patch soon.
In theory the best solution is to improve the performance of the
"byKey.front" and "byValue.front" idioms.
If that's not possible and you need to add the
firstKey/firstValue functions, then it's a good idea to make the
D front-end rewrite "byKey.front" with a call to "firstKey" and a
"byValue.front" with a call to firstValue.
ah, and x.getAndRemove() too, it's handy sometimes. but this
will need new druntime hook, i think. ;-)
x.pop() sounds nicer :-)
Bye,
bearophile