If I have the following:
bool type;
int main();
{
type = false;
}
void update()
{
if( type == false )
{
//do something
}
else
{
//do something else
}
}
The code will set the value of type to either true or false, using an if statement will cause the compiler to check what the value is every update, I want to avoid this and only do one check since the type will be set and then not changed. Is there some way to make it only check once?