aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVibhav Pant2017-02-09 19:12:59 +0530
committerVibhav Pant2017-02-09 19:12:59 +0530
commit13eabbd80b121d0b86de55321bd5dda5d99fb857 (patch)
tree471c3bfee23c6e1b429f1f85d597f49b637f771d
parent3189f954ebdf739831a40e1b336505da60ea66c6 (diff)
downloademacs-13eabbd80b121d0b86de55321bd5dda5d99fb857.tar.gz
emacs-13eabbd80b121d0b86de55321bd5dda5d99fb857.zip
bytecode.c (exec_byte_code): Use h->count instead of HASH_TABLE_SIZE
-rw-r--r--src/bytecode.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index fb10a6d6914..299c651b90e 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1425,10 +1425,17 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1425#endif 1425#endif
1426 ptrdiff_t i; 1426 ptrdiff_t i;
1427 struct Lisp_Hash_Table *h = XHASH_TABLE(jmp_table); 1427 struct Lisp_Hash_Table *h = XHASH_TABLE(jmp_table);
1428 if (HASH_TABLE_SIZE (h) <= 5) 1428
1429#ifdef BYTE_CODE_SAFE
1430 /* Hash tables for switch are declared with :size set to exact
1431 number of cases, so this should always be true. */
1432 eassert (HASH_TABLE_SIZE (h) == h->count);
1433#endif
1434
1435 if (h->count <= 5)
1429 { /* Do a linear search if there are not many cases 1436 { /* Do a linear search if there are not many cases
1430 FIXME: 5 is arbitrarily chosen. */ 1437 FIXME: 5 is arbitrarily chosen. */
1431 for (i = 0; i < HASH_TABLE_SIZE (h); i++) 1438 for (i = 0; i < h->count; i++)
1432 { 1439 {
1433#ifdef BYTE_CODE_SAFE 1440#ifdef BYTE_CODE_SAFE
1434 eassert (!NILP (HASH_HASH (h, i))); 1441 eassert (!NILP (HASH_HASH (h, i)));