Makes some more lists lazy (#94388)

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
Bloop
2025-12-28 19:57:42 +01:00
committed by GitHub
co-authored by SyncIt21 MrMelbert
parent b88e1a1328
commit 53ed83bb9d
58 changed files with 268 additions and 253 deletions
+7 -7
View File
@@ -43,11 +43,11 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
///Stores the real name of the person who originally got this dna datum. Used primarily for changelings
var/real_name
///All mutations are from now on here
var/list/mutations = list()
var/list/mutations
///Temporary changes to the UE
var/list/temporary_mutations = list()
var/list/temporary_mutations
///For temporary name/ui/ue/blood_type modifications
var/list/previous = list()
var/list/previous
var/mob/living/holder
///List of which mutations this carbon has and its assigned block
var/mutation_index[DNA_MUTATION_BLOCKS]
@@ -76,9 +76,9 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
QDEL_NULL(species)
mutations.Cut() //This only references mutations, just dereference.
temporary_mutations.Cut() //^
previous.Cut() //^
LAZYNULL(mutations) //This only references mutations, just dereference.
LAZYNULL(temporary_mutations) //^
LAZYNULL(previous) //^
return ..()
@@ -89,7 +89,7 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
new_dna.unique_features = unique_features
new_dna.features = features.Copy()
new_dna.real_name = real_name
new_dna.temporary_mutations = temporary_mutations.Copy()
new_dna.temporary_mutations = LAZYLISTDUPLICATE(temporary_mutations)
new_dna.mutation_index = mutation_index
new_dna.default_mutation_genes = default_mutation_genes
//if the new DNA has a holder, transform them immediately, otherwise save it