Moves space initialization check to unit test - Saves 0.065s of init time (#71796)

This hasn't been hit in a long time and this is an extremely hot proc,
doing these checks in unit tests should catch any cases, though
unlikely.

This has zero cost at runtime because `if (FALSE)` statically compiles
out.
This commit is contained in:
Mothblocks
2022-12-12 23:31:36 -08:00
committed by GitHub
parent bfc2916779
commit 453080d3fc
2 changed files with 6 additions and 2 deletions
+3 -2
View File
@@ -47,8 +47,9 @@
SHOULD_CALL_PARENT(FALSE)
air = space_gas
if(flags_1 & INITIALIZED_1)
stack_trace("Warning: [src]([type]) initialized multiple times!")
if (PERFORM_ALL_TESTS(focus_only/multiple_space_initialization))
if(flags_1 & INITIALIZED_1)
stack_trace("Warning: [src]([type]) initialized multiple times!")
flags_1 |= INITIALIZED_1
@@ -15,5 +15,8 @@
/// Checks that every icon sent to vending machines is valid
/datum/unit_test/focus_only/invalid_vending_machine_icon_states
/// Checks that space does not initialize multiple times
/datum/unit_test/focus_only/multiple_space_initialization
/// Checks that smoothing_groups and canSmoothWith are properly sorted in /atom/Initialize
/datum/unit_test/focus_only/sorted_smoothing_groups