Module Name: src
Committed By: rillig
Date: Sat Nov 21 23:25:30 UTC 2020
Modified Files:
src/usr.bin/make: suff.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/usr.bin/make/suff.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.279 src/usr.bin/make/suff.c:1.280
--- src/usr.bin/make/suff.c:1.279 Sat Nov 21 23:09:07 2020
+++ src/usr.bin/make/suff.c Sat Nov 21 23:25:29 2020
@@ -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 @@ SuffFindCmds(Src *targ, SrcList *slst)
* 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;
}