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: inline HashIter_Init
details: https://anonhg.NetBSD.org/src/rev/436e4ede9894
branches: trunk
changeset: 1027153:436e4ede9894
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Dec 07 21:58:01 2021 +0000
description:
make: inline HashIter_Init
It is only used in non-critical code paths, but the generated code gets
smaller by inlining.
No functional change.
diffstat:
usr.bin/make/hash.c | 13 ++-----------
usr.bin/make/hash.h | 11 ++++++++++-
2 files changed, 12 insertions(+), 12 deletions(-)
diffs (59 lines):
diff -r aca9791e4b83 -r 436e4ede9894 usr.bin/make/hash.c
--- a/usr.bin/make/hash.c Tue Dec 07 21:47:21 2021 +0000
+++ b/usr.bin/make/hash.c Tue Dec 07 21:58:01 2021 +0000
@@ -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 @@
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.
diff -r aca9791e4b83 -r 436e4ede9894 usr.bin/make/hash.h
--- a/usr.bin/make/hash.h Tue Dec 07 21:47:21 2021 +0000
+++ b/usr.bin/make/hash.h Tue Dec 07 21:58:01 2021 +0000
@@ -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 @@
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 *);
Home |
Main Index |
Thread Index |
Old Index