BOOL bSomeBool;
Which is faster in Objective-c, to assign or to test?
bSomeBool= NO;
or
if(bSomeBool)
{
}
instead. Looking for every bit of savings I can get.
EDIT:
The reason I’m asking is that I’m doing this
if(bSomeBool)
{
bSomeBool= NO;
}
in my drawing code a couple of times, so I was wondering whether I should just do this
bSomeBool= NO;
instead. Looking for as much savings as I can get.
Saving a single instruction in drawing code will be like pouring a thimble full of water from the Titanic as she breaks up and heads to Davy Jones.
It will not make any difference. If you want to optimize, draw less and use core animation more.