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 condition



details:   https://anonhg.NetBSD.org/src/rev/439a688e4907
branches:  trunk
changeset: 936290:439a688e4907
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jul 24 08:24:23 2020 +0000

description:
make(1): remove redundant condition

If there are multiple words from brk_string, none of them can be empty.
And if there is oneSingleWord that is empty, it doesn't hurt to add 0
bytes.

diffstat:

 usr.bin/make/var.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r 827e28c7a314 -r 439a688e4907 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Fri Jul 24 08:22:05 2020 +0000
+++ b/usr.bin/make/var.c        Fri Jul 24 08:24:23 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.307 2020/07/24 08:22:05 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.308 2020/07/24 08:24:23 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.307 2020/07/24 08:22:05 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.308 2020/07/24 08:24:23 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.307 2020/07/24 08:22:05 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.308 2020/07/24 08:24:23 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1550,10 +1550,8 @@
     }
 
     for (i = start; (step < 0) == (i >= end); i += step) {
-       if (av[i][0] != '\0') {
-           SepBuf_AddBytes(&buf, av[i], strlen(av[i]));
-           SepBuf_Sep(&buf);
-       }
+       SepBuf_AddBytes(&buf, av[i], strlen(av[i]));
+       SepBuf_Sep(&buf);
     }
 
     free(as);



Home | Main Index | Thread Index | Old Index