From cf43c539407ac9a76154605d83247aa98d712426 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 12 Sep 2010 14:06:55 -0700 Subject: [PATCH] AGGREGATE: Simplify code. ds_chomp() returns whether it trimmed off a character, and we might as well use that instead of doing a redundant check. --- src/language/stats/aggregate.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/language/stats/aggregate.c b/src/language/stats/aggregate.c index bcc8a3be09..15376f62b8 100644 --- a/src/language/stats/aggregate.c +++ b/src/language/stats/aggregate.c @@ -453,14 +453,8 @@ parse_aggregate_functions (struct lexer *lexer, const struct dictionary *dict, goto error; } - exclude = MV_ANY; - ds_assign_string (&function_name, lex_tokstr (lexer)); - - ds_chomp (&function_name, '.'); - - if (lex_tokid(lexer)[strlen (lex_tokid (lexer)) - 1] == '.') - exclude = MV_SYSTEM; + exclude = ds_chomp (&function_name, '.') ? MV_SYSTEM : MV_ANY; for (function = agr_func_tab; function->name; function++) if (!strcasecmp (function->name, ds_cstr (&function_name))) -- 2.30.2