[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 1542d17 2/2: Avoid returning negative numbers from
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 1542d17 2/2: Avoid returning negative numbers from `hash-table-count' |
Date: |
Sun, 14 Jul 2019 00:47:08 -0400 (EDT) |
branch: master
commit 1542d17324c46a1406355ed10a48a97f51014e90
Author: Pip Cet <address@hidden>
Commit: Paul Eggert <address@hidden>
Avoid returning negative numbers from `hash-table-count'
* src/fns.c (Fhash_table_count): Rehash argument if necessary.
---
src/fns.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/fns.c b/src/fns.c
index 54dafe0..238a371 100644
--- 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);
}