emacs-devel
[Top][All Lists]
Advanced

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

Bug in sxhash


From: Kim F. Storm
Subject: Bug in sxhash
Date: Tue, 21 Mar 2006 17:02:09 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Is sxhash really supposed to ignore the cdr of a cons?

(sxhash '(a . 1))  => 57
(sxhash '(a . 2))  => 57
(sxhash '(a . 3))  => 57

It works ok for lists:

(sxhash '(a 1))  => 913
(sxhash '(a 2))  => 914
(sxhash '(a 3))  => 915


Below is a proposed patch which gives this result:

(sxhash '(a . 1))  => 913
(sxhash '(a . 2))  => 914
(sxhash '(a . 3))  => 915

[i.e. there is no difference between lists and cons,
but at least it isn't completely stupid]


*** fns.c       06 Feb 2006 18:21:46 +0100      1.407
--- fns.c       21 Mar 2006 16:57:07 +0100      
***************
*** 5114,5119 ****
--- 5114,5125 ----
        hash = SXHASH_COMBINE (hash, hash2);
        }
  
+   if (!NILP (list))
+     {
+       unsigned hash2 = sxhash (list, depth + 1);
+       hash = SXHASH_COMBINE (hash2, hash);
+     }
+ 
    return hash;
  }
  

--
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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