Changes all .len to length() where applicable (#25174)

* Globals work

* Double access works

* All other things

* Revert "All other things"

This reverts commit 6574442eb6.

* More changes that compile and work

* IT WORKS AAAAAA

* Changes even more .len to length()

* Apply suggestions from code review

* Update code/datums/mind.dm

* Update code/__HELPERS/sorts/InsertSort.dm

Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>

* Update code/__HELPERS/sanitize_values.dm

Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>

---------

Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com>
Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>
This commit is contained in:
DGamerL
2024-04-19 17:32:09 +00:00
committed by GitHub
co-authored by Deniz FunnyMan3595
parent bdd417ada0
commit bad8b31afa
369 changed files with 1162 additions and 1163 deletions
+17 -17
View File
@@ -15,7 +15,7 @@ using /datum/datacore/proc/manifest_inject(), or manifest_insert()
GLOBAL_LIST_EMPTY(PDA_Manifest)
/datum/datacore/proc/get_manifest_json()
if(GLOB.PDA_Manifest.len)
if(length(GLOB.PDA_Manifest))
return
var/heads[0]
var/sec[0]
@@ -38,44 +38,44 @@ GLOBAL_LIST_EMPTY(PDA_Manifest)
heads[++heads.len] = list("name" = name, "rank" = rank, "active" = isactive)
department = 1
depthead = 1
if(rank == "Captain" && heads.len != 1)
heads.Swap(1, heads.len)
if(rank == "Captain" && length(heads) != 1)
heads.Swap(1, length(heads))
if(real_rank in GLOB.active_security_positions)
sec[++sec.len] = list("name" = name, "rank" = rank, "active" = isactive)
department = 1
if(depthead && sec.len != 1)
sec.Swap(1, sec.len)
if(depthead && length(sec) != 1)
sec.Swap(1, length(sec))
if(real_rank in GLOB.engineering_positions)
eng[++eng.len] = list("name" = name, "rank" = rank, "active" = isactive)
department = 1
if(depthead && eng.len != 1)
eng.Swap(1, eng.len)
if(depthead && length(eng) != 1)
eng.Swap(1, length(eng))
if(real_rank in GLOB.medical_positions)
med[++med.len] = list("name" = name, "rank" = rank, "active" = isactive)
department = 1
if(depthead && med.len != 1)
med.Swap(1, med.len)
if(depthead && length(med) != 1)
med.Swap(1, length(med))
if(real_rank in GLOB.science_positions)
sci[++sci.len] = list("name" = name, "rank" = rank, "active" = isactive)
department = 1
if(depthead && sci.len != 1)
sci.Swap(1, sci.len)
if(depthead && length(sci) != 1)
sci.Swap(1, length(sci))
if(real_rank in GLOB.service_positions)
ser[++ser.len] = list("name" = name, "rank" = rank, "active" = isactive)
department = 1
if(depthead && ser.len != 1)
ser.Swap(1, ser.len)
if(depthead && length(ser) != 1)
ser.Swap(1, length(ser))
if(real_rank in GLOB.supply_positions)
sup[++sup.len] = list("name" = name, "rank" = rank, "active" = isactive)
department = 1
if(depthead && sup.len != 1)
sup.Swap(1, sup.len)
if(depthead && length(sup) != 1)
sup.Swap(1, length(sup))
if(real_rank in GLOB.nonhuman_positions)
bot[++bot.len] = list("name" = name, "rank" = rank, "active" = isactive)
@@ -105,7 +105,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest)
manifest_inject(H)
/datum/datacore/proc/manifest_modify(name, assignment)
if(GLOB.PDA_Manifest.len)
if(length(GLOB.PDA_Manifest))
GLOB.PDA_Manifest.Cut()
var/datum/data/record/foundrecord
var/real_title = assignment
@@ -137,7 +137,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest)
GLOBAL_VAR_INIT(record_id_num, 1001)
/datum/datacore/proc/manifest_inject(mob/living/carbon/human/H)
if(GLOB.PDA_Manifest.len)
if(length(GLOB.PDA_Manifest))
GLOB.PDA_Manifest.Cut()
if(H.mind && (H.mind.assigned_role != H.mind.special_role))