From 3911b067ed00ad1cda5cdebd9945f1e5d80b6a57 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 4 Oct 2015 08:59:30 -0700 Subject: Eliminate recursion from make_struct. * struct.c (make_struct): Don't wastefully evaluate the symbolp test twice via recursion; assign and fall through. --- struct.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index 0a38677a..bc490a6e 100644 --- a/struct.c +++ b/struct.c @@ -326,8 +326,10 @@ val make_struct(val type, val plist, struct args *args) if (!typeobj) uw_throwf(error_s, lit("~a: ~s doesn't name a struct type"), self, type, nao); - return make_struct(typeobj, plist, args); - } else { + type = typeobj; + } + + { struct struct_type *st = coerce(struct struct_type *, cobj_handle(type, struct_type_s)); cnum nslots = st->nslots, sl; -- cgit v1.2.3