Lets say we've got a list of something, and we want to see if something else is within range of it.
I want my code to be efficient. So, which is more efficient?
for (var/atom/moveable/thisThing in globalListOfThings)
if (src in range(5,thisThing))
return(1)
return(0)
or
for (var/atom/moveable/thisThing in globalListOfThings)
if (get_dist(thisThing,src) <= 5)
return(1)
return(0)
Assume the globalListOfThings can be quite long and the map is potentially huge.
If in doubt, though, just profile it and run each option 1000/10000/100000 times.