From 76746cd57a665976f1f56818aca32cfe4b5a0789 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 5 Dec 2017 16:51:36 -0500 Subject: [PATCH 1/2] Minor component optimizations (#33269) * Minor component optimizations * Second argument of list.Copy is optional --- code/datums/components/_component.dm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index e346f60bff..0f435d0a03 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -14,13 +14,13 @@ if(!isnum(dupe_mode)) qdel(src) CRASH("[type]: Invalid dupe_mode!") - if(dupe_type && !ispath(dupe_type)) + var/dt = dupe_type + if(dt && !ispath(dt)) qdel(src) CRASH("[type]: Invalid dupe_type!") parent = P - var/list/arguments = args.Copy() - arguments.Cut(1, 2) + var/list/arguments = args.Copy(2) if(Initialize(arglist(arguments)) == COMPONENT_INCOMPATIBLE) qdel(src, TRUE, TRUE) return @@ -167,8 +167,7 @@ var/list/comps = datum_components if(!comps) return NONE - var/list/arguments = args.Copy() - arguments.Cut(1, 2) + var/list/arguments = args.Copy(2) var/target = comps[/datum/component] if(!length(target)) var/datum/component/C = target