From 29e3d1c56f07a53d1955c9a71e68f70f3b901728 Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Thu, 28 Dec 2023 19:04:43 +0100 Subject: Abstract predicate and constant for unused hash keys Qunbound is used for many things; using a predicate and constant for the specific purpose of unused hash entry keys allows us to locate them and make changes much more easily. * src/lisp.h (HASH_UNUSED_ENTRY_KEY, hash_unused_entry_key_p): New constant and function. * 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 (make_hash_table, maybe_resize_hash_table, hash_put) (hash_remove_from_table, hash_clear, sweep_weak_table, Fmaphash): * src/json.c (lisp_to_json_nonscalar_1): * src/minibuf.c (Ftry_completion, Fall_completions, Ftest_completion): * src/print.c (print, print_object): Use them. --- src/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/json.c') diff --git a/src/json.c b/src/json.c index af5f30c7275..d98b312ecc9 100644 --- a/src/json.c +++ b/src/json.c @@ -364,7 +364,7 @@ lisp_to_json_nonscalar_1 (Lisp_Object lisp, for (ptrdiff_t i = 0; i < HASH_TABLE_SIZE (h); ++i) { Lisp_Object key = HASH_KEY (h, i); - if (!BASE_EQ (key, Qunbound)) + if (!hash_unused_entry_key_p (key)) { CHECK_STRING (key); Lisp_Object ekey = json_encode (key); -- cgit v1.2.3