RPG Starter

by Falacy
An Open Source Demo/Game with everything you'll need to get started on your very own BYOND Game!
ID:292230
 
for(var/client/C)

or

for(var/mob/M in world) if(M.client)

The first one looks faster, since it is only looping through clients, correct?
Exonit wrote:
for(var/client/C)

or

for(var/mob/M in world) if(M.client)

The first one looks faster, since it is only looping through clients, correct?

If it was me, I would choose the second one . Like you said, the first one looks the fastest . Cause it looks like its only looping threw players, and then the second one looks threw all the mob's in the world, then sorts them out into 2 groups . So Im guessing the 1st one ?
I keep a list of Players, and then loop through that. Its also useful for getting player counts.
As for your specific question, it would most likely be faster to loop through clients.