aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorVibhav Pant2017-02-11 23:41:56 +0530
committerVibhav Pant2017-02-11 23:41:56 +0530
commite27351e5ddeb9366e25f7c341684d79c487074ce (patch)
tree6025cdf9c1b0cab13ed10563211e691263f7e651 /src/bytecode.c
parenta35335c767fd7915e4203b3bba60d9c66df7a116 (diff)
downloademacs-e27351e5ddeb9366e25f7c341684d79c487074ce.tar.gz
emacs-e27351e5ddeb9366e25f7c341684d79c487074ce.zip
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.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 156265faeea..af94d03b17d 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,
1428 if (h->count <= 5) 1428 if (h->count <= 5)
1429 { /* Do a linear search if there are not many cases 1429 { /* Do a linear search if there are not many cases
1430 FIXME: 5 is arbitrarily chosen. */ 1430 FIXME: 5 is arbitrarily chosen. */
1431 EMACS_UINT hash_code = h->test.hashfn (&h->test, v1); 1431 Lisp_Object hash_code = h->test.cmpfn
1432 ? make_number(h->test.hashfn (&h->test, v1)) : Qnil;
1433
1432 for (i = h->count; 0 <= --i;) 1434 for (i = h->count; 0 <= --i;)
1433 if (EQ (v1, HASH_KEY (h, i)) 1435 if (EQ (v1, HASH_KEY (h, i))
1434 || (h->test.cmpfn 1436 || (h->test.cmpfn
1435 && hash_code == XUINT (HASH_HASH (h, i)) 1437 && EQ (hash_code, HASH_HASH (h, i))
1436 && h->test.cmpfn (&h->test, v1, HASH_KEY (h, i)))) 1438 && h->test.cmpfn (&h->test, v1, HASH_KEY (h, i))))
1437 break; 1439 break;
1438 1440