summaryrefslogtreecommitdiff
path: root/src/minibuf.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2024-01-19 15:17:52 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2024-01-21 11:21:51 +0100
commitfec87a4b36a67688932e7bb7e1720bd2c4363a61 (patch)
tree8549ad5b17f75ba86a77e5fd8dea8a77bb3133af /src/minibuf.c
parent0a07603ae8db41f69e83b1bfec6e28a92f737852 (diff)
downloademacs-fec87a4b36a67688932e7bb7e1720bd2c4363a61.tar.gz
emacs-fec87a4b36a67688932e7bb7e1720bd2c4363a61.tar.bz2
emacs-fec87a4b36a67688932e7bb7e1720bd2c4363a61.zip
Add C macro for hash table iteration
This removes some boilerplate code and further reduces dependencies on hash table implementation internals. * src/lisp.h (DOHASH): New. * src/comp.c (compile_function, Fcomp__compile_ctxt_to_file): * src/composite.c (composition_gstring_cache_clear_font): * src/emacs-module.c (module_global_reference_p): * src/fns.c (Fmaphash): * src/json.c (lisp_to_json_nonscalar_1): * src/minibuf.c (Ftest_completion): * src/print.c (print): Use it instead of a hand-written loop.
Diffstat (limited to 'src/minibuf.c')
-rw-r--r--src/minibuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index 8198dc0f360..857b62d94f0 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2114,10 +2114,10 @@ the values STRING, PREDICATE and `lambda'. */)
goto found_matching_key;
}
else
- for (i = 0; i < HASH_TABLE_SIZE (h); ++i)
+ DOHASH (h, j)
{
+ i = j;
tem = HASH_KEY (h, i);
- if (hash_unused_entry_key_p (tem)) continue;
Lisp_Object strkey = (SYMBOLP (tem) ? Fsymbol_name (tem) : tem);
if (!STRINGP (strkey)) continue;
if (BASE_EQ (Fcompare_strings (string, Qnil, Qnil,