3 ms·
I think the word static was misused in nkurz's post. static variables are always initialized, at least to 0. Initializing a stack variable shouldn't harm perf
by tedunangst 14y ago
I think the word static was misused in nkurz's post. static variables are always initialized, at least to 0. Initializing a stack variable shouldn't harm performance.
- nkurz 14y agoCorrect, I was trying to describe initializing a stack variable to a constant array, and shouldn't have used the word static. In retrospect, I think the cost of this is probably just the same as zeroing it, since behind the scenes it has to be copied from a constant? But the rejection wasn't due to the performance harm, but was based on a philosophy that one shouldn't change "provably" correct just to make it more compliant.