From 54ae1a7a0e8a1a759de3bb941ed972ea1fc19a54 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 1 Jan 2009 17:52:48 +0000 Subject: [PATCH] Simplify daisy chaining function call arguments. [r25027] --- parser.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/parser.c b/parser.c index e989179..08dceb8 100644 --- a/parser.c +++ b/parser.c @@ -8093,18 +8093,13 @@ static expression_t *parse_call_expression(expression_t *expression) add_anchor_token(','); if (token.type != ')') { - call_argument_t *last_argument = NULL; - - while (true) { - call_argument_t *argument = allocate_ast_zero(sizeof(argument[0])); - + call_argument_t **anchor = &call->arguments; + for (;;) { + call_argument_t *argument = allocate_ast_zero(sizeof(*argument)); argument->expression = parse_assignment_expression(); - if (last_argument == NULL) { - call->arguments = argument; - } else { - last_argument->next = argument; - } - last_argument = argument; + + *anchor = argument; + anchor = &argument->next; if (token.type != ',') break; -- 2.20.1