projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61a79e8
)
Avoid returning negative numbers from `hash-table-count'
author
Pip Cet
<pipcet@gmail.com>
Sun, 14 Jul 2019 04:44:27 +0000
(21:44 -0700)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Sun, 14 Jul 2019 04:45:27 +0000
(21:45 -0700)
* src/fns.c (Fhash_table_count): Rehash argument if necessary.
src/fns.c
patch
|
blob
|
history
diff --git
a/src/fns.c
b/src/fns.c
index 54dafe07ac80f690bf18c57df33085854ed73a9c..238a37193c1d0d6eb5494e7584569adfcc59bdd8 100644
(file)
--- a/
src/fns.c
+++ b/
src/fns.c
@@
-4875,7
+4875,9
@@
DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0,
doc: /* Return the number of elements in TABLE. */)
(Lisp_Object table)
{
- return make_fixnum (check_hash_table (table)->count);
+ struct Lisp_Hash_Table *h = check_hash_table (table);
+ hash_rehash_if_needed (h);
+ return make_fixnum (h->count);
}