On Friday, 24 July 2020 at 21:19:28 UTC, H. S. Teoh wrote:
On Fri, Jul 24, 2020 at 08:34:17PM +0000, aberba via Digitalmars-d-announce wrote:
Wrote something on the feature that makes D my favorite programming language

https://opensource.com/article/20/7/d-programming

Nitpick: evenNumbers doesn't need to return int[]. In fact, dropping the .array makes it even better because it avoids an unnecessary allocation when you're not going to store the array -- writeln is well able to handle printing arbitrary ranges. Let the caller call .array when he wishes the store the array; if it's transient, omitting .array saves an allocation.


T

Yeah, you're right.

Reply via email to