Optimize a couple things

This commit is contained in:
Chompstation Bot
2021-07-20 21:30:20 +00:00
parent 4a6c523aa6
commit 15cafbe65b
262 changed files with 9437 additions and 934 deletions

View File

@@ -12,7 +12,7 @@ var/datum/admin_secrets/admin_secrets = new()
for(var/datum/admin_secret_category/category in categories)
category_assoc[category.type] = category
for(var/item_type in (typesof(/datum/admin_secret_item) - /datum/admin_secret_item))
for(var/item_type in subtypesof(/datum/admin_secret_item))
var/datum/admin_secret_item/secret_item = item_type
if(!initial(secret_item.name))
continue

View File

@@ -302,7 +302,7 @@
to_chat(usr, "<span class='warning'>Looks like you didn't select a mob.</span>")
return
var/list/possible_modifiers = typesof(/datum/modifier) - /datum/modifier
var/list/possible_modifiers = subtypesof(/datum/modifier)
var/new_modifier_type = tgui_input_list(usr, "What modifier should we add to [L]?", "Modifier Type", possible_modifiers)
if(!new_modifier_type)

View File

@@ -238,8 +238,7 @@ Example: USING PROCCALL = BLOCKING, SELECT = FORCE_NULLS, PRIORITY = HIGH SELECT
do
CHECK_TICK
finished = TRUE
for(var/i in running)
var/datum/SDQL2_query/query = i
for(var/datum/SDQL2_query/query as anything in running)
if(QDELETED(query))
running -= query
continue
@@ -562,8 +561,7 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
location = list(location)
if(type == "*")
for(var/i in location)
var/datum/d = i
for(var/datum/d as anything in location)
if(d.can_vv_get() || superuser)
out += d
SDQL2_TICK_CHECK

View File

@@ -82,8 +82,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
return
var/list/dat = list("<html><head><title>[title]</title></head>")
dat += "<A HREF='?_src_=holder;ahelp_tickets=[state]'>Refresh</A><br><br>"
for(var/I in l2b)
var/datum/admin_help/AH = I
for(var/datum/admin_help/AH as anything in l2b)
dat += "<span class='adminnotice'><span class='adminhelp'>Ticket #[AH.id]</span>: <A HREF='?_src_=holder;ahelp=\ref[AH];ahelp_action=ticket'>[AH.initiator_key_name]: [AH.name]</A></span><br>"
usr << browse(dat.Join(), "window=ahelp_list[state];size=600x480")
@@ -92,8 +91,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/datum/admin_help_tickets/proc/stat_entry()
var/num_disconnected = 0
stat("Active Tickets:", astatclick.update("[active_tickets.len]"))
for(var/I in active_tickets)
var/datum/admin_help/AH = I
for(var/datum/admin_help/AH as anything in active_tickets)
if(AH.initiator)
stat("#[AH.id]. [AH.initiator_key_name]:", AH.statclick.update())
else
@@ -119,8 +117,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
//Get a ticket given a ckey
/datum/admin_help_tickets/proc/CKey2ActiveTicket(ckey)
for(var/I in active_tickets)
var/datum/admin_help/AH = I
for(var/datum/admin_help/AH as anything in active_tickets)
if(AH.initiator_ckey == ckey)
return AH
@@ -669,8 +666,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/proc/ircadminwho()
var/list/message = list("Admins: ")
var/list/admin_keys = list()
for(var/adm in GLOB.admins)
var/client/C = adm
for(var/client/C as anything in GLOB.admins)
admin_keys += "[C][C.holder.fakekey ? "(Stealth)" : ""][C.is_afk() ? "(AFK)" : ""]"
for(var/admin in admin_keys)

View File

@@ -282,8 +282,7 @@ Ccomp's first proc.
GLOB.respawn_timers -= target
var/found_client = FALSE
for(var/c in GLOB.clients)
var/client/C = c
for(var/client/C as anything in GLOB.clients)
if(C.ckey == target)
found_client = C
to_chat(C, "<span class='notice'><B>You may now respawn. You should roleplay as if you learned nothing about the round during your time with the dead.</B></span>")

View File

@@ -46,8 +46,7 @@ GLOBAL_PROTECT(VVpixelmovement)
var/things = get_all_of_type(type, subtypes)
var/i = 0
for(var/thing in things)
var/datum/D = thing
for(var/datum/D as anything in things)
i++
//try one of 3 methods to shorten the type text:
// fancy type,