diff --git a/src/cont.c b/src/cont.c index ae6b3c36..3164ee6d 100644 --- a/src/cont.c +++ b/src/cont.c @@ -179,38 +179,30 @@ pic_values(pic_state *pic, size_t c, ...) { va_list ap; size_t i; - pic_value head = pic_none_value(); va_start(ap, c); for (i = 0; i < c; ++i) { pic->ci->fp[i] = va_arg(ap, pic_value); - if (i == 0) { - head = pic->ci->fp[0]; - } } pic->ci->fp[i] = pic_undef_value(); va_end(ap); - return head; + return c == 0 ? pic_none_value() : pic->ci->fp[0]; } pic_value pic_values_by_array(pic_state *pic, size_t argc, pic_value *argv) { size_t i; - pic_value head = pic_none_value(); for (i = 0; i < argc; ++i) { pic->ci->fp[i] = argv[i]; - if (i == 0) { - head = pic->ci->fp[0]; - } } pic->ci->fp[i] = pic_undef_value(); - return head; + return argc == 0 ? pic_none_value() : pic->ci->fp[0]; } static pic_value