[MIRROR] Replaces a portion of C-style for loops with the more commonplace for loops, which are faster. [MDB IGNORE] (#9298)

* Replaces a portion of C-style for loops with the more commonplace for loops, which are faster.

* Update code/modules/projectiles/boxes_magazines/_box_magazine.dm

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-11-08 15:50:29 +00:00
committed by GitHub
parent f44a214a2f
commit 98428cdfb5
49 changed files with 124 additions and 125 deletions

View File

@@ -75,7 +75,7 @@
stack_trace("Tried loading unsupported ammocasing type [load_type] into ammo box [type].")
return
for(var/i = max(1, stored_ammo.len), i <= max_ammo, i++)
for(var/i in max(1, stored_ammo.len) to max_ammo)
stored_ammo += new round_check() //SKYRAT EDTI CHANGE - SEC_HUAL - Moving to nullspace seems to help with lag.
update_ammo_count()

View File

@@ -55,7 +55,7 @@
if(!load_type)
load_type = ammo_type
for(var/i = 1, i <= max_ammo, i++)
for(var/i in 1 to max_ammo)
if(!give_round(new load_type(src)))
break
update_appearance()

View File

@@ -100,7 +100,7 @@
/obj/item/gun/energy/proc/update_ammo_types()
var/obj/item/ammo_casing/energy/shot
for (var/i = 1, i <= ammo_type.len, i++)
for (var/i in 1 to ammo_type.len)
var/shottype = ammo_type[i]
shot = new shottype(src)
ammo_type[i] = shot