From 89e37938ca10dd50249819d2ba105a7b85cdea64 Mon Sep 17 00:00:00 2001 From: StarSmasher Date: Wed, 6 May 2015 17:41:32 +0200 Subject: [PATCH] Optimizes invalidateCameraCache() Before optimization it used 20.155 Total CPU/Self CPU on 183 calls After optimization it used 0.443 Total CPU/Self CPU on 223 calls. --- code/game/machinery/computer/camera.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index f71f181ed3..a50436346d 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -1,9 +1,10 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 /proc/invalidateCameraCache() - for(var/obj/machinery/computer/security/s in world) + for(var/obj/machinery/computer/security/s in machines) s.camera_cache = null - for(var/datum/alarm/A in world) + var/datum/alarm_handler/AHandler = new /datum/alarm_handler() + for(var/datum/alarm/A in AHandler.alarms) A.cameras = null /obj/machinery/computer/security