aboutsummaryrefslogtreecommitdiffstats
path: root/src/pdumper.c
diff options
context:
space:
mode:
authorStefan Monnier2019-07-26 16:55:59 -0400
committerStefan Monnier2019-07-26 16:55:59 -0400
commit0f09808e522cd3de6bd9ea1350beed1feddfbda9 (patch)
tree6831e3a40ff70ab0091cd691bbcdc37d14153d6e /src/pdumper.c
parent0dc5a85a1c3772a6e78f077719d82f437f626b1e (diff)
downloademacs-0f09808e522cd3de6bd9ea1350beed1feddfbda9.tar.gz
emacs-0f09808e522cd3de6bd9ea1350beed1feddfbda9.zip
Adjust remaining uses of `NILP (HASH_HASH)`.
* src/json.c (lisp_to_json_toplevel_1): * src/pdumper.c (dump_hash_table_stable_p, hash_table_contents): * src/print.c (print, print_vectorlike): * src/minibuf.c (Ftry_completion, Fall_completions, Ftest_completion): Use `EQ (HASH_KEY, Qunbound)` instead of `NILP (HASH_HASH)`.
Diffstat (limited to 'src/pdumper.c')
-rw-r--r--src/pdumper.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/pdumper.c b/src/pdumper.c
index 1a5d1f32ba5..31f4f33adf3 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2629,18 +2629,20 @@ dump_hash_table_stable_p (const struct Lisp_Hash_Table *hash)
2629 bool is_equal = hash->test.hashfn == hashfn_equal; 2629 bool is_equal = hash->test.hashfn == hashfn_equal;
2630 ptrdiff_t size = HASH_TABLE_SIZE (hash); 2630 ptrdiff_t size = HASH_TABLE_SIZE (hash);
2631 for (ptrdiff_t i = 0; i < size; ++i) 2631 for (ptrdiff_t i = 0; i < size; ++i)
2632 if (!NILP (HASH_HASH (hash, i))) 2632 {
2633 { 2633 Lisp_Object key = HASH_KEY (hash, i);
2634 Lisp_Object key = HASH_KEY (hash, i); 2634 if (!EQ (key, Qunbound))
2635 bool key_stable = (dump_builtin_symbol_p (key) 2635 {
2636 || FIXNUMP (key) 2636 bool key_stable = (dump_builtin_symbol_p (key)
2637 || (is_equal 2637 || FIXNUMP (key)
2638 && (STRINGP (key) || BOOL_VECTOR_P (key))) 2638 || (is_equal
2639 || ((is_equal || is_eql) 2639 && (STRINGP (key) || BOOL_VECTOR_P (key)))
2640 && (FLOATP (key) || BIGNUMP (key)))); 2640 || ((is_equal || is_eql)
2641 if (!key_stable) 2641 && (FLOATP (key) || BIGNUMP (key))));
2642 return false; 2642 if (!key_stable)
2643 } 2643 return false;
2644 }
2645 }
2644 2646
2645 return true; 2647 return true;
2646} 2648}
@@ -2652,8 +2654,11 @@ hash_table_contents (Lisp_Object table)
2652 Lisp_Object contents = Qnil; 2654 Lisp_Object contents = Qnil;
2653 struct Lisp_Hash_Table *h = XHASH_TABLE (table); 2655 struct Lisp_Hash_Table *h = XHASH_TABLE (table);
2654 for (ptrdiff_t i = 0; i < HASH_TABLE_SIZE (h); ++i) 2656 for (ptrdiff_t i = 0; i < HASH_TABLE_SIZE (h); ++i)
2655 if (!NILP (HASH_HASH (h, i))) 2657 {
2656 dump_push (&contents, Fcons (HASH_KEY (h, i), HASH_VALUE (h, i))); 2658 Lisp_Object key = HASH_KEY (h, i);
2659 if (!EQ (key, Qunbound))
2660 dump_push (&contents, Fcons (key, HASH_VALUE (h, i)));
2661 }
2657 return Fnreverse (contents); 2662 return Fnreverse (contents);
2658} 2663}
2659 2664