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): document inefficient cache lookup in D...
details: https://anonhg.NetBSD.org/src/rev/7dc00c5f07b9
branches: trunk
changeset: 1016097:7dc00c5f07b9
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Nov 08 11:57:49 2020 +0000
description:
make(1): document inefficient cache lookup in DirMatchFiles
diffstat:
usr.bin/make/dir.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 908f406ecd54 -r 7dc00c5f07b9 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c Sun Nov 08 11:37:46 2020 +0000
+++ b/usr.bin/make/dir.c Sun Nov 08 11:57:49 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.201 2020/11/08 09:34:55 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.202 2020/11/08 11:57:49 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -134,7 +134,7 @@
#include "job.h"
/* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */
-MAKE_RCSID("$NetBSD: dir.c,v 1.201 2020/11/08 09:34:55 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.202 2020/11/08 11:57:49 rillig Exp $");
#define DIR_DEBUG0(text) DEBUG0(DIR, text)
#define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -589,6 +589,9 @@
Boolean isDot = dirName[0] == '.' && dirName[1] == '\0';
HashIter hi;
+ /* XXX: Iterating over all hash entries is inefficient. If the pattern
+ * is a plain string without any wildcards, a direct lookup is faster. */
+
HashIter_Init(&hi, &dir->files);
while (HashIter_Next(&hi) != NULL) {
const char *base = hi.entry->key;
Home |
Main Index |
Thread Index |
Old Index