Module Name: src
Committed By: rillig
Date: Sun Dec 27 14:41:25 UTC 2020
Modified Files:
src/usr.bin/make: var.c
Log Message:
make(1): remove outdated comment about string comparisons
Back in 1993, the variables in a context were stored in a linked list.
Searching such a list indeed required literally thousands of calls to
strcmp. In make.h 1.22 from 1999-09-15, the linked list was replaced
with a hash table, requiring much fewer string comparisons. Since then,
the rationale doesn't apply anymore.
To generate a diff of this commit:
cvs rdiff -u -r1.771 -r1.772 src/usr.bin/make/var.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/var.c
diff -u src/usr.bin/make/var.c:1.771 src/usr.bin/make/var.c:1.772
--- src/usr.bin/make/var.c:1.771 Sun Dec 27 14:02:12 2020
+++ src/usr.bin/make/var.c Sun Dec 27 14:41:25 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.771 2020/12/27 14:02:12 rillig Exp $ */
+/* $NetBSD: var.c,v 1.772 2020/12/27 14:41:25 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.771 2020/12/27 14:02:12 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.772 2020/12/27 14:41:25 rillig Exp $");
typedef enum VarFlags {
VAR_NONE = 0,
@@ -988,16 +988,6 @@ Var_SetWithFlags(const char *name, const
* name name of the variable to set, is expanded once
* val value to give to the variable
* ctxt context in which to set it
- *
- * Notes:
- * The variable is searched for only in its context before being
- * created in that context. I.e. if the context is VAR_GLOBAL,
- * only VAR_GLOBAL->context is searched. Likewise if it is VAR_CMDLINE,
- * only VAR_CMDLINE->context is searched. This is done to avoid the
- * literally thousands of unnecessary strcmp's that used to be done to
- * set, say, $(@) or $(<).
- * If the context is VAR_GLOBAL though, we check if the variable
- * was set in VAR_CMDLINE from the command line and skip it if so.
*/
void
Var_Set(const char *name, const char *val, GNode *ctxt)