Merge pull request #15352 from Citadel-Station-13/silicons-patch-4

typecache filter list microoptimization
This commit is contained in:
Lin
2021-11-11 21:25:53 +00:00
committed by GitHub
+3 -6
View File
@@ -173,23 +173,20 @@
/proc/typecache_filter_list(list/atoms, list/typecache)
RETURN_TYPE(/list)
. = list()
for(var/thing in atoms)
var/atom/A = thing
for(var/atom/A as anything in atoms)
if (typecache[A.type])
. += A
/proc/typecache_filter_list_reverse(list/atoms, list/typecache)
RETURN_TYPE(/list)
. = list()
for(var/thing in atoms)
var/atom/A = thing
for(var/atom/A as anything in atoms)
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
for(var/atom/A as anything in atoms)
if(typecache_include[A.type] && !typecache_exclude[A.type])
. += A