Replacing more C-style for loops with the faster, traditional ones. (#62908)

This commit is contained in:
Ghom
2021-11-19 02:39:05 +01:00
committed by GitHub
parent d4f4e05a37
commit 243cd2bfa5
26 changed files with 60 additions and 60 deletions
+1 -1
View File
@@ -188,7 +188,7 @@
var/icon/mob_snapshot = getFlatIcon(target)
var/icon/cached_icon = new()
for(var/i=1, i<=CHRONO_FRAME_COUNT, i++)
for(var/i in 1 to CHRONO_FRAME_COUNT)
var/icon/removing_frame = icon('icons/obj/chronos.dmi', "erasing", SOUTH, i)
var/icon/mob_icon = icon(mob_snapshot)
mob_icon.Blend(removing_frame, ICON_MULTIPLY)
@@ -299,7 +299,7 @@
playsound(src, 'sound/items/taperecorder/taperecorder_print.ogg', 50, FALSE)
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 in 1 to mytape.storedinfo.len)
t1 += "[mytape.storedinfo[i]]<BR>"
P.info = t1
var/tapename = mytape.name
+1 -1
View File
@@ -197,7 +197,7 @@
the_targets.Add(T3,T4)
var/list/water_particles=list()
for(var/a=0, a<5, a++)
for(var/a in 1 to 5)
var/obj/effect/particle_effect/water/W = new /obj/effect/particle_effect/water(get_turf(src))
var/my_target = pick(the_targets)
water_particles[W] = my_target
+1 -1
View File
@@ -52,7 +52,7 @@
return FALSE
on_reading_start(user)
reading = TRUE
for(var/i=1, i<=pages_to_mastery, i++)
for(var/i in 1 to pages_to_mastery)
if(!turn_page(user))
on_reading_stopped()
reading = FALSE
+2 -2
View File
@@ -69,7 +69,7 @@
// Add some random stamps.
if(stamped == TRUE)
var/stamp_count = rand(1, stamp_max)
for(var/i = 1, i <= stamp_count, i++)
for(var/i in 1 to stamp_count)
stamps += list("stamp_[rand(2, 6)]")
update_icon()
@@ -157,7 +157,7 @@
else
goodies += job_goodies
for(var/iterator = 0, iterator < goodie_count, iterator++)
for(var/iterator in 1 to goodie_count)
var/target_good = pick_weight(goodies)
var/atom/movable/target_atom = new target_good(src)
body.log_message("[key_name(body)] received [target_atom.name] in the mail ([target_good])", LOG_GAME)