
Feb. 26, 2010
11:03 p.m.
Stephen J. Turnbull wrote:
Greg Ewing writes:
the tuples produced by the for-loop could be put straight into the result list, instead of having to re-pack k and v into a new tuple.
This is a straightforward optimization that should be done anyway, though, if it isn't done already.
I don't think it's as straightforward as all that. You can't do it at compile time, because even if the target and result expression are textually identical, the repacked item isn't necessarily the same type as the one produced by the iteration. -- Greg