On Friday, 19 December 2014 at 10:57:47 UTC, aldanor wrote:
Something about the loop in the first case not depending on n and the compiler being able to figure it is out and only drop into recursion once?That's just a wild guess, but does it get transformed into something like this?
typeof(return) result;
typeof(return) tmp = foo1(data, i + 1, max);
foreach (immutable n; data)
result ~= tmp;
