Jos van Uden:
On 13-2-2012 15:14, bearophile wrote:Where possible it's good to add "static" to nested functions:Why?
For optimization, to be sure there's no closure allocation or a second pointer. But also for code correctness, because static functions can't use automatic variables defined in the enclosing function. This makes the code simpler to understand (the pure attribute has a similar purpose, you are sure your global function is not using global mutable variables).
Bye, bearophile