17.06.2018, 01:12
Hi all,
I'm not sure if I'm being smart here or if I'm doing a mistake, so i thought I'd ask you guys.
I tried simplifying some variables like so:
Before:
After:
I figured that since the CPU can only execute one thing at a time, it can only be executing one function at a time.
Therefore if I always use this variable to immediately format and use it at the same 'time' then it's a good solution?
I don't see any problems at this time and I think multi-threading is not a possibility for SAMP Servers.
Thank you in advance for your opinions.
rt-2
I'm not sure if I'm being smart here or if I'm doing a mistake, so i thought I'd ask you guys.
I tried simplifying some variables like so:
Before:
Код:
UsefullFunction() { new sqlquery[512]; format(sqlquery, sizeof(sqlquery), "SELECT ETC"); //code that uses 'sqlquery' var. } UsefullFunction2etc() { new sqlquery[512]; format(sqlquery, sizeof(sqlquery), "SELECT AND ALL"); //code that uses 'sqlquery' var. }
Код:
new sqlquery[512]; UsefullFunction() { format(sqlquery, sizeof(sqlquery), "SELECT ETC"); //code that uses 'sqlquery' var. } UsefullFunction2etc() { format(sqlquery, sizeof(sqlquery), "SELECT AND ALL"); //code that uses 'sqlquery' var. }
Therefore if I always use this variable to immediately format and use it at the same 'time' then it's a good solution?
I don't see any problems at this time and I think multi-threading is not a possibility for SAMP Servers.
Thank you in advance for your opinions.
rt-2