diff options
| author | Pip Cet | 2019-07-13 21:44:27 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-07-13 21:45:27 -0700 |
| commit | 1542d17324c46a1406355ed10a48a97f51014e90 (patch) | |
| tree | d47032a80783c71b6ff8530c9c4abc9c3207942c | |
| parent | 61a79e88e4a29854af519bf0e48c3a71197e0ddd (diff) | |
| download | emacs-1542d17324c46a1406355ed10a48a97f51014e90.tar.gz emacs-1542d17324c46a1406355ed10a48a97f51014e90.zip | |
Avoid returning negative numbers from `hash-table-count'
* src/fns.c (Fhash_table_count): Rehash argument if necessary.
| -rw-r--r-- | src/fns.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -4875,7 +4875,9 @@ DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0, | |||
| 4875 | doc: /* Return the number of elements in TABLE. */) | 4875 | doc: /* Return the number of elements in TABLE. */) |
| 4876 | (Lisp_Object table) | 4876 | (Lisp_Object table) |
| 4877 | { | 4877 | { |
| 4878 | return make_fixnum (check_hash_table (table)->count); | 4878 | struct Lisp_Hash_Table *h = check_hash_table (table); |
| 4879 | hash_rehash_if_needed (h); | ||
| 4880 | return make_fixnum (h->count); | ||
| 4879 | } | 4881 | } |
| 4880 | 4882 | ||
| 4881 | 4883 | ||