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;