for( var/v as num in list )
ID:2513473
Oct 2 2019, 1:17 pm
|
|
Ran into it reading the reference via F1 in dreammaker. I can see the usefulness but I myself usually keep lists type specific.
|
In response to Kozuma3
|
|
On that note, it's more efficient to loop through a list of things that you know the type of with "as anything":
// this is faster With "as anything", the loop doesn't bother filtering the list at all, so if you know for sure that Players only contains /mob/player instances (which it should), then it's faster. |
In response to Kaiochao
|
|
That makes sense, and is cool to know. TILx2
|
It's faster than casting the variable type and filtering that way, as long as you don't need the compile-time security.