Just a simple question, say I have a map with 100000 squares on it, will this proc be any faster than the latter proc?
Maybe 1000 squares have a CheckVar set to 1
var/turf/T
for(T in world)
if(T.CheckVar >= 1)
T.CheckVar = 0
...any faster than...
var/turf/T
for(T in world)
T.CheckVar = 0
?? I'm just wondering if just plain setting them to 0 is any slower than checking before setting certain ones to zero. Is this understandable?
|
||||||||||||
I just can't help myself with these topics. Anyways, I can't really answer your question directly--I don't really know that there would be that much of a difference. If you're looking for ways to speed it up, though, you might consider keeping a global (or otherwise handily accessible) list of all the turfs which have CheckVar greater than 1, and loop through those. I think, anyways--I'm not sure, and it'll probably depend on the situation. I just like lists.