Module Name:    src
Committed By:   rillig
Date:           Thu Oct 22 19:14:06 UTC 2020

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

Log Message:
make(1): remove code for circular lists from Lst_Next

Since make does not use circular lists, they have been removed from the
list library a few weeks ago.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/usr.bin/make/lst.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/lst.c
diff -u src/usr.bin/make/lst.c:1.79 src/usr.bin/make/lst.c:1.80
--- src/usr.bin/make/lst.c:1.79	Mon Oct 19 21:57:37 2020
+++ src/usr.bin/make/lst.c	Thu Oct 22 19:14:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.79 2020/10/19 21:57:37 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.80 2020/10/22 19:14:06 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -34,7 +34,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: lst.c,v 1.79 2020/10/19 21:57:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.80 2020/10/22 19:14:06 rillig Exp $");
 
 /* Allocate and initialize a list node.
  *
@@ -343,12 +343,11 @@ Lst_ForEachUntil(List *list, LstActionUn
 	 */
 	if (next != tln->next) {
 	    next = tln->next;
-	    done = 0;
+	    done = FALSE;
 	}
 
-	if (tln->priv_deleted) {
-	    free((char *)tln);
-	}
+	if (tln->priv_deleted)
+	    free(tln);
 	tln = next;
 	if (result || LstIsEmpty(list) || done)
 	    break;
@@ -441,18 +440,7 @@ Lst_Next(List *list)
     } else {
 	node = list->priv_curr->next;
 	list->priv_curr = node;
-
-	if (node == list->first || node == NULL) {
-	    /*
-	     * If back at the front, then we've hit the end...
-	     */
-	    list->priv_lastAccess = Tail;
-	} else {
-	    /*
-	     * Reset to Middle if gone past first.
-	     */
-	    list->priv_lastAccess = Middle;
-	}
+	list->priv_lastAccess = node == NULL ? Tail : Middle;
     }
 
     return node;

Reply via email to