07.07.2018, 15:51
Do I have to check if variable's value is different before setting it?
Example
or
Which way is better? Or is there no difference?
Example
Code:
new bool:IsSpawned[MAX_PLAYERS]; public OnPlayerSpawn(playerid) { IsSpawned[playerid] = true; return 1; }
Code:
new bool:IsSpawned[MAX_PLAYERS]; public OnPlayerSpawn(playerid) { if(IsSpawned[playerid] != true) { IsSpawned[playerid] = true; } return 1; }