On 03/09/2012 02:29 PM, Jos van Uden wrote:
On 13-2-2012 15:14, bearophile wrote:
Zach the Mystic:

void setRandomColorPair( ref ColorPair cp )
{
import std.random;
ubyte u(int a, int b) { return cast(ubyte) uniform(a,b); }

Where possible it's good to add "static" to nested functions:


Why?

Because then you don't have to rely on the compiler to optimize away the unneeded context pointer parameter. It should be able to do that though. I don't know if DMD is.

Reply via email to