From 3b0f991761e3cfad652b8f203a6e89fcf4c671db Mon Sep 17 00:00:00 2001 From: Vladisvell <73733747+Vladisvell@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:42:47 +0500 Subject: [PATCH] add: Z level checking optimization (#6240) (cherry picked from commit 7e50571049471cba79e27eca8f4aed847eae7907) --- code/modules/space_management/zlevel_manager.dm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/code/modules/space_management/zlevel_manager.dm b/code/modules/space_management/zlevel_manager.dm index 3cf8b7b3a4f..6d87270a74e 100644 --- a/code/modules/space_management/zlevel_manager.dm +++ b/code/modules/space_management/zlevel_manager.dm @@ -43,15 +43,10 @@ GLOBAL_DATUM_INIT(space_manager, /datum/zlev_manager, new()) /datum/zlev_manager/proc/get_zlev(z) - if(!("[z]" in z_list)) - log_runtime(EXCEPTION("Unmanaged z level: '[z]'")) - else - return z_list["[z]"] + return z_list["[z]"] == null ? log_runtime(EXCEPTION("Unmanaged z level: '[z]'")) : z_list["[z]"] /datum/zlev_manager/proc/get_zlev_by_name(A) - if(!(A in levels_by_name)) - log_runtime(EXCEPTION("Non-existent z level: '[A]'")) - return levels_by_name[A] + return levels_by_name[A] == null ? log_runtime(EXCEPTION("Non-existent z level: '[A]'")) : levels_by_name[A] /* * "Dirt" management