bc: trivial simplification in bc_parse_return()
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 5 Dec 2018 19:28:26 +0000 (20:28 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 5 Dec 2018 19:28:26 +0000 (20:28 +0100)
function                                             old     new   delta
bc_parse_stmt                                       2276    2271      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/bc.c

index 656ecd8929684529c12997bc9cf312cec13a0964..b454d4b2bd85a325b8b6a6b9f13d93884abfd847 100644 (file)
@@ -4047,14 +4047,11 @@ static BcStatus bc_parse_return(BcParse *p)
        else {
 
                s = bc_parse_expr(p, 0, bc_parse_next_expr);
-               if (s && s != BC_STATUS_PARSE_EMPTY_EXP)
-                       return s;
-
                if (s == BC_STATUS_PARSE_EMPTY_EXP) {
                        bc_parse_push(p, BC_INST_RET0);
                        s = bc_lex_next(&p->l);
-                       if (s) return s;
                }
+               if (s) return s;
 
                if (!paren || p->l.t.last != BC_LEX_RPAREN) {
                        s = bc_posix_error("POSIX requires parentheses around return expressions");