mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-17 11:05:16 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user