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(1): remove redundant null check in SuffFin...



details:   https://anonhg.NetBSD.org/src/rev/5d09cd79e6e4
branches:  trunk
changeset: 946266:5d09cd79e6e4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 21 23:25:29 2020 +0000

description:
make(1): remove redundant null check in SuffFindCmds

Src.suff is never null.  It is initialized in the constructor and then
never modified again.  It cannot be marked as const though because memory
allocation and initialization are separated in SrcNew.

diffstat:

 usr.bin/make/suff.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (29 lines):

diff -r a0753dc6fc44 -r 5d09cd79e6e4 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sat Nov 21 23:09:07 2020 +0000
+++ b/usr.bin/make/suff.c       Sat Nov 21 23:25:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.279 2020/11/21 23:09:07 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.280 2020/11/21 23:25:29 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*     "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.279 2020/11/21 23:09:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.280 2020/11/21 23:25:29 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -1087,9 +1087,7 @@
         * XXX: Handle multi-stage transformations here, too.
         */
 
-       /* XXX: Can targ->suff be NULL here? */
-       if (targ->suff != NULL &&
-           Lst_FindDatum(suff->parents, targ->suff) != NULL)
+       if (Lst_FindDatum(suff->parents, targ->suff) != NULL)
            break;
     }
 



Home | Main Index | Thread Index | Old Index