What's more efficient, GetVehiclePoolSize or create an iterator ?
#1

Hey guys, as the title says, what do you think is better to use ?
This:
PHP код:
for(new 0GetVehiclePoolSize(); ji++) 
or
PHP код:
public OnVehicleStreamIn(vehicleidforplayerid)
{
if(!
Iter_Contains(Vehiclesvehicleid)) Iter_Add(Vehiclesvehicleid);
return 
1;
}
foreach(new 
Vehicles
Reply
#2

It's 2 different things. Surely iteration is perfect for a loop but you should consider that you can use it more efficiently on more things than a loop.
Reply
#3

Quote:
Originally Posted by vassilis
Посмотреть сообщение
It's 2 different things. Surely iteration is perfect for a loop but you should consider that you can use it more efficiently on more things than a loop.
Such as ?
Reply
#4

Quote:
Originally Posted by NeXoR
Посмотреть сообщение
PHP код:
public OnVehicleStreamIn(vehicleidforplayerid)
{
if(!
Iter_Contains(Vehiclesvehicleid)) Iter_Add(Vehiclesvehicleid);
return 
1;
}
foreach(new 
Vehicles
That code is bad, this public is per player.
Reply
#5

Just use:

PHP код:
for(new GetVehiclePoolSize(); != 0i--) 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)