mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 03:26:31 +01:00
[MIRROR] Moves space initialization check to unit test - Saves 0.065s of init time [MDB IGNORE] (#18126)
* 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. * Moves space initialization check to unit test - Saves 0.065s of init time Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
@@ -55,8 +55,9 @@
|
||||
icon_state = SPACE_ICON_STATE(x, y, z)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user