Improves Tesla Performance

This commit is contained in:
CitadelStationBot
2017-08-06 03:07:38 -05:00
parent 521c149627
commit 0eea5ad53d
2 changed files with 31 additions and 23 deletions
+10 -3
View File
@@ -91,16 +91,23 @@
//returns a new list with only atoms that are in typecache L
/proc/typecache_filter_list(list/atoms, list/typecache)
. = list()
for (var/thing in atoms)
for(var/thing in atoms)
var/atom/A = thing
if (typecache[A.type])
. += A
/proc/typecache_filter_list_reverse(list/atoms, list/typecache)
. = list()
for (var/thing in atoms)
for(var/thing in atoms)
var/atom/A = thing
if (!typecache[A.type])
if(!typecache[A.type])
. += A
/proc/typecache_filter_multi_list_exclusion(list/atoms, list/typecache_include, list/typecache_exclude)
. = list()
for(var/thing in atoms)
var/atom/A = thing
if(typecache_include[A.type] && !typecache_exclude[A.type])
. += A
//Like typesof() or subtypesof(), but returns a typecache instead of a list