Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make: merge duplicate code in CondParser_FuncCall



details:   https://anonhg.NetBSD.org/src/rev/cee3481ceb41
branches:  trunk
changeset: 1027569:cee3481ceb41
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 12 08:42:29 2021 +0000

description:
make: merge duplicate code in CondParser_FuncCall

No functional change.

diffstat:

 usr.bin/make/cond.c |  13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diffs (35 lines):

diff -r 564c55d28d16 -r cee3481ceb41 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Sun Dec 12 08:36:21 2021 +0000
+++ b/usr.bin/make/cond.c       Sun Dec 12 08:42:29 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.299 2021/12/12 08:36:21 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.300 2021/12/12 08:42:29 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.299 2021/12/12 08:36:21 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.300 2021/12/12 08:42:29 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -772,15 +772,8 @@
                return false;
 
        arglen = ParseFuncArg(par, &cp, doEval, fn->fn_name, &arg);
-       if (arglen == 0) {
-               *out_token = TOK_FALSE;
-               free(arg);
-               par->p = cp;
-               return true;
-       }
+       *out_token = ToToken(arglen != 0 && (!doEval || fn->fn_eval(arg)));
 
-       /* Evaluate the argument using the required function. */
-       *out_token = ToToken(!doEval || fn->fn_eval(arg));
        free(arg);
        par->p = cp;
        return true;



Home | Main Index | Thread Index | Old Index