Module Name:    src
Committed By:   rillig
Date:           Thu Oct 22 20:09:07 UTC 2020

Modified Files:
        src/usr.bin/make: make.c

Log Message:
make(1): replace Lst_Open with simple iteration in Make_ProcessWait


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/usr.bin/make/make.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/make.c
diff -u src/usr.bin/make/make.c:1.170 src/usr.bin/make/make.c:1.171
--- src/usr.bin/make/make.c:1.170	Thu Oct 22 20:00:13 2020
+++ src/usr.bin/make/make.c	Thu Oct 22 20:09:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.170 2020/10/22 20:00:13 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.171 2020/10/22 20:09:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include    "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.170 2020/10/22 20:00:13 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.171 2020/10/22 20:09:07 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -1246,8 +1246,7 @@ Make_ProcessWait(GNodeList *targs)
 	    Lst_PrependAll(examine, pgn->cohorts);
 
 	owln = pgn->children->first;
-	Lst_Open(pgn->children);
-	for (; (ln = Lst_Next(pgn->children)) != NULL; ) {
+	for (ln = pgn->children->first; ln != NULL; ln = ln->next) {
 	    GNode *cgn = ln->datum;
 	    if (cgn->type & OP_WAIT) {
 		add_wait_dependency(owln, cgn);
@@ -1256,7 +1255,6 @@ Make_ProcessWait(GNodeList *targs)
 		Lst_Append(examine, cgn);
 	    }
 	}
-	Lst_Close(pgn->children);
     }
 
     Lst_Free(examine);

Reply via email to