I know that the use of ; in GOlang, but for the Golang compiler which is more efficient, should we put it or not?
thru.
Asked:
2020-09-25 13:21:46 +0800 CST
As for calculation speed, it is the same:
for(int a = 0; a<10; a++)
{
var1[a] = random(255);
}
for(int b = 0; b<10; b++)
{
var2[b] = random(255);
}
a:
for(int a = 0; a<10; a++)
{
var1[a] = random(255);
var2[a] = random(255);
}
Because out of ignorance and my common sense, despite being two cycles (therefore, 20 searches in the arrays) in the first case, in the second case the value is changed twice as many variables as in the first.
Thank you very much