Module Name: src
Committed By: rillig
Date: Tue Dec 7 21:58:01 UTC 2021
Modified Files:
src/usr.bin/make: hash.c hash.h
Log Message:
make: inline HashIter_Init
It is only used in non-critical code paths, but the generated code gets
smaller by inlining.
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/make/hash.c
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/make/hash.h
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/hash.c
diff -u src/usr.bin/make/hash.c:1.65 src/usr.bin/make/hash.c:1.66
--- src/usr.bin/make/hash.c:1.65 Sun Sep 12 08:36:14 2021
+++ src/usr.bin/make/hash.c Tue Dec 7 21:58:01 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.c,v 1.65 2021/09/12 08:36:14 rillig Exp $ */
+/* $NetBSD: hash.c,v 1.66 2021/12/07 21:58:01 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
#include "make.h"
/* "@(#)hash.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: hash.c,v 1.65 2021/09/12 08:36:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: hash.c,v 1.66 2021/12/07 21:58:01 rillig Exp $");
/*
* The ratio of # entries to # buckets at which we rebuild the table to
@@ -333,15 +333,6 @@ HashTable_DeleteEntry(HashTable *t, Hash
abort();
}
-/* Set things up for iterating over all entries in the hash table. */
-void
-HashIter_Init(HashIter *hi, HashTable *t)
-{
- hi->table = t;
- hi->nextBucket = 0;
- hi->entry = NULL;
-}
-
/*
* Return the next entry in the hash table, or NULL if the end of the table
* is reached.
Index: src/usr.bin/make/hash.h
diff -u src/usr.bin/make/hash.h:1.40 src/usr.bin/make/hash.h:1.41
--- src/usr.bin/make/hash.h:1.40 Sun Apr 11 12:46:54 2021
+++ src/usr.bin/make/hash.h Tue Dec 7 21:58:01 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.h,v 1.40 2021/04/11 12:46:54 rillig Exp $ */
+/* $NetBSD: hash.h,v 1.41 2021/12/07 21:58:01 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -120,6 +120,15 @@ HashEntry_Set(HashEntry *h, void *datum)
h->value = datum;
}
+/* Set things up for iterating over all entries in the hash table. */
+MAKE_INLINE void
+HashIter_Init(HashIter *hi, HashTable *t)
+{
+ hi->table = t;
+ hi->nextBucket = 0;
+ hi->entry = NULL;
+}
+
void HashTable_Init(HashTable *);
void HashTable_Done(HashTable *);
HashEntry *HashTable_FindEntry(HashTable *, const char *);