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 outdated comment about string c...



details:   https://anonhg.NetBSD.org/src/rev/c4923235a87d
branches:  trunk
changeset: 948342:c4923235a87d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 27 14:41:25 2020 +0000

description:
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.

diffstat:

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

diffs (35 lines):

diff -r 6bcb210d5ed8 -r c4923235a87d usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Dec 27 14:02:12 2020 +0000
+++ b/usr.bin/make/var.c        Sun Dec 27 14:41:25 2020 +0000
@@ -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 @@
  *     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)



Home | Main Index | Thread Index | Old Index