summaryrefslogtreecommitdiff
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorVibhav Pant <vibhavp@gmail.com>2017-02-11 18:17:57 +0530
committerVibhav Pant <vibhavp@gmail.com>2017-02-11 18:17:57 +0530
commita75d080b17a6b6c6296ff4e24d8129d77bb3bb6b (patch)
treef06e54725c6cd8d52ad5a1e9df752d09e8ca256e /src/bytecode.c
parentdcd0e6fe3ae24a716e1f665b12d877681bb8cc21 (diff)
downloademacs-a75d080b17a6b6c6296ff4e24d8129d77bb3bb6b.tar.gz
* src/bytecode.c: Refactor to follow GNU coding standards
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 1ac28110320..f3eab60c593 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1420,9 +1420,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
search as the jump table. */
Lisp_Object jmp_table = POP;
Lisp_Object v1 = POP;
-#ifdef BYTE_CODE_SAFE
- CHECK_TYPE (HASH_TABLE_P (jmp_table), Qhash_table_p, jmp_table);
-#endif
ptrdiff_t i;
struct Lisp_Hash_Table *h = XHASH_TABLE(jmp_table);
@@ -1430,19 +1427,18 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
{ /* Do a linear search if there are not many cases
FIXME: 5 is arbitrarily chosen. */
EMACS_UINT hash_code = h->test.hashfn (&h->test, v1);
+ /* Hash tables for switch are declared with :size set to the
+ exact number of cases, thus
+ HASH_TABLE_SIZE (h) == h->count. */
for (i = 0; i < h->count; i++)
{
-#ifdef BYTE_CODE_SAFE
- eassert (!NILP (HASH_HASH (h, i)));
-#endif
- /* Hash tables for switch are declared with :size set to the
- exact number of cases, thus
- HASH_TABLE_SIZE (h) == h->count. */
-
- if ((EQ (v1, HASH_KEY (h, i)) ||
- (h->test.cmpfn
- && hash_code == XUINT (HASH_HASH (h, i))
- && h->test.cmpfn (&h->test, v1, HASH_KEY (h, i)))))
+ if (BYTE_CODE_SAFE)
+ eassert (!NILP (HASH_HASH (h, i)));
+
+ if (EQ (v1, HASH_KEY (h, i))
+ || (h->test.cmpfn
+ && hash_code == XUINT (HASH_HASH (h, i))
+ && h->test.cmpfn (&h->test, v1, HASH_KEY (h, i))))
{
op = XINT (HASH_VALUE (h, i));
goto op_branch;