[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/byte-switch 3189f95: bytecode.c (exec_byte_code):
From: |
Vibhav Pant |
Subject: |
[Emacs-diffs] feature/byte-switch 3189f95: bytecode.c (exec_byte_code): don't check hash code in linear search. |
Date: |
Thu, 9 Feb 2017 08:18:58 -0500 (EST) |
branch: feature/byte-switch
commit 3189f954ebdf739831a40e1b336505da60ea66c6
Author: Vibhav Pant <address@hidden>
Commit: Vibhav Pant <address@hidden>
bytecode.c (exec_byte_code): don't check hash code in linear search.
* src/bytecode.c (exec_byte_code): Don't check that the hash code is
not nil when linear scanning the jump table. Hash tables for are
declared with :size as the exact number of cases, so each entry i
should have a hash code. When BYTE_CODE_SAFE, do it as a sanity
check.
---
src/bytecode.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/bytecode.c b/src/bytecode.c
index 9bb7bd4..fb10a6d 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1430,8 +1430,10 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector,
Lisp_Object maxdepth,
FIXME: 5 is arbitrarily chosen. */
for (i = 0; i < HASH_TABLE_SIZE (h); i++)
{
- if (!NILP (HASH_HASH (h, i)) &&
- (EQ (v1, HASH_KEY (h, i)) ||
+#ifdef BYTE_CODE_SAFE
+ eassert (!NILP (HASH_HASH (h, i)));
+#endif
+ if ((EQ (v1, HASH_KEY (h, i)) ||
(h->test.cmpfn &&
h->test.cmpfn (&h->test, v1, HASH_KEY (h, i)))))
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] feature/byte-switch 3189f95: bytecode.c (exec_byte_code): don't check hash code in linear search.,
Vibhav Pant <=