17.10.2016, 18:54
Quote:
Why?
Difference? Код HTML:
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) Код HTML:
for(new i = 0; i <= GetPlayerPoolSize(); i++) |
Second one calls GetPlayerPoolSize multiple times (Depending on the value it actually outputs).
So yes, the first one is actually faster.
But to answer your main question, iterators (y_iterate/foreach) are much faster.
They only loop through the existing values, while the second one loops N times.
*N = The highest player id in the server.