From 12a82618daabf8eb8b98e9876a76702aad38b81b Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Thu, 26 Oct 2017 15:21:00 -0700 Subject: [PATCH] Remove some unneeded null checks in lighting These weren't needed, and ran thousands of times per second during high lighting activity, and were pretty high up in the line by line profile of lighting for what was basically a noop. --- code/modules/lighting/lighting_source.dm | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/code/modules/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm index 178f091fb77..31ddb27b2a7 100644 --- a/code/modules/lighting/lighting_source.dm +++ b/code/modules/lighting/lighting_source.dm @@ -271,8 +271,6 @@ source_turf.luminosity = Ceiling(light_range) for(T in view(Ceiling(light_range), source_turf)) for (thing in T.get_corners(source_turf)) - if(!thing) - continue C = thing corners[C] = 0 turfs += T @@ -294,8 +292,6 @@ LAZYINITLIST(effect_str) if (needs_update == LIGHTING_VIS_UPDATE) for (thing in corners - effect_str) // New corners - if(!thing) - continue C = thing LAZYADD(C.affecting, src) if (!C.active) @@ -305,8 +301,6 @@ else L = corners - effect_str for (thing in L) // New corners - if(!thing) - continue C = thing LAZYADD(C.affecting, src) if (!C.active) @@ -315,8 +309,6 @@ APPLY_CORNER(C) for (thing in corners - L) // Existing corners - if(!thing) - continue C = thing if (!C.active) effect_str[C] = 0 @@ -325,8 +317,6 @@ L = effect_str - corners for (thing in L) // Old, now gone, corners. - if(!thing) - continue C = thing REMOVE_CORNER(C) LAZYREMOVE(C.affecting, src)