Yes, need ==s there.
Or this:
switch (state) {
case 0:
//code
break;
case 1:
//code
break;
case 2:
//code
break;
}
Then you're not going thru 3 comparisons very time, just jumping right to the correct one.
Yes, need ==s there.
Or this:
switch (state) {
case 0:
//code
break;
case 1:
//code
break;
case 2:
//code
break;
}
Then you're not going thru 3 comparisons very time, just jumping right to the correct one.