emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] feature/byte-switch e27351e: src/bytecode.c (exec_byte_cod


From: Vibhav Pant
Subject: [Emacs-diffs] feature/byte-switch e27351e: src/bytecode.c (exec_byte_code): Make hash_code a Lisp_Object.
Date: Sat, 11 Feb 2017 13:13:11 -0500 (EST)

branch: feature/byte-switch
commit e27351e5ddeb9366e25f7c341684d79c487074ce
Author: Vibhav Pant <address@hidden>
Commit: Vibhav Pant <address@hidden>

    src/bytecode.c (exec_byte_code): Make hash_code a Lisp_Object.
    
    This avoids using XUINT every time while comparing it with
    HASH_HASH (h, i), replacing it with EQ.
---
 src/bytecode.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/bytecode.c b/src/bytecode.c
index 156265f..af94d03 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1428,11 +1428,13 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object 
vector, Lisp_Object maxdepth,
             if (h->count <= 5)
               { /* 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);
+                Lisp_Object hash_code = h->test.cmpfn
+                  ? make_number(h->test.hashfn (&h->test, v1)) : Qnil;
+
                 for (i = h->count; 0 <= --i;)
                   if (EQ (v1, HASH_KEY (h, i))
                       || (h->test.cmpfn
-                          && hash_code == XUINT (HASH_HASH (h, i))
+                          && EQ (hash_code, HASH_HASH (h, i))
                           && h->test.cmpfn (&h->test, v1, HASH_KEY (h, i))))
                     break;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]