Will 'static' optimise my code?
Code:
void samRing::getParameterDisplay (long index, char *text)
{
static char waveName [4] [4] = { "Sin", "Tri", "Squ", "Saw" };
switch (index)
{
case pFreq:
sprintf (text, "%d", (int) (freq * MAX_FREQ));
break;
case pWaveType:
strcpy (text, waveName [waveType]);
break;
case pDry:
sprintf (text, "%d", (int) (dry * 100));
break;
}
}
I'm presuming that because the array is static, the assignments will only occur once. In all subsequent calls, this will be skipped over. Am I right?