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
+4 -4
View File
@@ -43,7 +43,7 @@
return W
/obj/item/autopsy_scanner/proc/add_data(obj/item/organ/O)
if(O.autopsy_data.len)
if(length(O.autopsy_data))
for(var/V in O.autopsy_data)
var/datum/autopsy_data/W = O.autopsy_data[V]
@@ -62,7 +62,7 @@
qdel(D.organs_scanned[O.name])
D.organs_scanned[O.name] = W.copy()
if(O.trace_chemicals.len)
if(length(O.trace_chemicals))
for(var/V in O.trace_chemicals)
if(O.trace_chemicals[V] > 0 && !chemtraces.Find(V))
chemtraces += V
@@ -97,7 +97,7 @@
else
scan_data += "<b>Time of death:</b> Unknown / Still alive<br><br>"
if(wdata.len)
if(length(wdata))
var/n = 1
for(var/wdata_idx in wdata)
var/datum/autopsy_data_scanner/D = wdata[wdata_idx]
@@ -140,7 +140,7 @@
n++
if(chemtraces.len)
if(length(chemtraces))
scan_data += "<b>Trace Chemicals: </b><br>"
for(var/chemID in chemtraces)
scan_data += chemID
@@ -49,7 +49,7 @@
var/G //Generator that will be spawned
var/turf/T = get_turf(choice)
if(choice.enginetype.len > 1) //If the beacon has multiple engine types
if(length(choice.enginetype) > 1) //If the beacon has multiple engine types
var/E = tgui_input_list(user, "You have selected a combined beacon, which option would you prefer?", "[src]", choice.enginetype)
if(E)
engtype = E
@@ -76,7 +76,7 @@
var/ailist[] = list()
for(var/mob/living/silicon/ai/A in GLOB.alive_mob_list)
ailist += A
if(ailist.len)
if(length(ailist))
var/mob/living/silicon/ai/announcer = pick(ailist)
announcer.say(";Engine delivery detected. Type: [engtype].") //Let's announce the terrible choice to everyone
@@ -490,11 +490,11 @@
/obj/item/radio/headset/proc/setupRadioDescription()
var/radio_text = ""
for(var/i = 1 to channels.len)
for(var/i = 1 to length(channels))
var/channel = channels[i]
var/key = get_radio_key_from_channel(channel)
radio_text += "[key] - [channel]"
if(i != channels.len)
if(i != length(channels))
radio_text += ", "
radio_desc = radio_text
@@ -258,7 +258,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
/obj/item/radio/proc/autosay(message, from, channel, role = "Unknown", follow_target_override) //BS12 EDIT
var/datum/radio_frequency/connection = null
if(channel && channels && channels.len > 0)
if(channel && channels && length(channels) > 0)
if(channel == "department")
channel = channels[1]
connection = secure_radio_connections[channel]
@@ -343,7 +343,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
return radio_connection
// Otherwise, if a channel is specified, look for it.
if(channels && channels.len > 0)
if(channels && length(channels) > 0)
if(message_mode == "department") // Department radio shortcut
message_mode = channels[1]
+3 -3
View File
@@ -80,13 +80,13 @@ SLIME SCANNER
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.reagents)
if(H.reagents.reagent_list.len)
if(length(H.reagents.reagent_list))
msgs += "<span class='boldnotice'>Subject contains the following reagents:</span>"
for(var/datum/reagent/R in H.reagents.reagent_list)
msgs += "<span class='notice'>[R.volume]u of [R.name][R.overdosed ? "</span> - <span class = 'boldannounceic'>OVERDOSING</span>" : ".</span>"]"
else
msgs += "<span class='notice'>Subject contains no reagents.</span>"
if(H.reagents.addiction_list.len)
if(length(H.reagents.addiction_list))
msgs += "<span class='danger'>Subject is addicted to the following reagents:</span>"
for(var/datum/reagent/R in H.reagents.addiction_list)
msgs += "<span class='danger'>[R.name] Stage: [R.addiction_stage]/5</span>"
@@ -664,7 +664,7 @@ SLIME SCANNER
if(!isnull(O.reagents))
var/dat = ""
var/blood_type = ""
if(O.reagents.reagent_list.len > 0)
if(length(O.reagents.reagent_list) > 0)
var/one_percent = O.reagents.total_volume / 100
for(var/datum/reagent/R in O.reagents.reagent_list)
if(R.id != "blood")
@@ -231,7 +231,7 @@
playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1)
var/obj/item/paper/P = new /obj/item/paper(get_turf(src))
var/t1 = "<B>Transcript:</B><BR><BR>"
for(var/i = 1, mytape.storedinfo.len >= i, i++)
for(var/i = 1, length(mytape.storedinfo) >= i, i++)
t1 += "[mytape.storedinfo[i]]<BR>"
P.info = t1
P.name = "paper- 'Transcript'"
@@ -145,7 +145,7 @@
new/obj/effect/temp_visual/teleport_abductor/syndi_teleporter(mobloc)
playsound(destination, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
new/obj/effect/temp_visual/teleport_abductor/syndi_teleporter(destination)
else if(!EMP_D && !(bagholding.len && !flawless)) // This is where the fun begins
else if(!EMP_D && !(length(bagholding) && !flawless)) // This is where the fun begins
var/direction = get_dir(user, destination)
panic_teleport(user, destination, direction)
else // Emp activated? Bag of holding? No saving throw for you
+2 -2
View File
@@ -64,13 +64,13 @@ GLOBAL_LIST_EMPTY(world_uplinks)
for(var/category in uplink_items)
cats[++cats.len] = list("cat" = category, "items" = list())
for(var/datum/uplink_item/I in uplink_items[category])
if(I.job && I.job.len)
if(I.job && length(I.job))
if(!(I.job.Find(job)) && uplink_type != UPLINK_TYPE_ADMIN)
continue
if(length(I.species))
if(!(I.species.Find(species)) && uplink_type != UPLINK_TYPE_ADMIN)
continue
cats[cats.len]["items"] += list(list(
cats[length(cats)]["items"] += list(list(
"name" = sanitize(I.name),
"desc" = sanitize(I.description()),
"cost" = I.cost,