[MLton-commit] r6475

Vesa Karvonen vesak at mlton.org
Fri Mar 14 04:12:06 PST 2008


Slightly better hash for arrays; mix in the length of an array, which is
invariant.

----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/generic/unstable/detail/value/hash.sml

----------------------------------------------------------------------

Modified: mltonlib/trunk/com/ssh/generic/unstable/detail/value/hash.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/detail/value/hash.sml	2008-03-14 01:42:36 UTC (rev 6474)
+++ mltonlib/trunk/com/ssh/generic/unstable/detail/value/hash.sml	2008-03-14 12:12:05 UTC (rev 6475)
@@ -144,7 +144,7 @@
             end
       end
 
-      fun array _ = prim (fn _ => 0wx6D52A54D)
+      fun array _ = prim (fn a => 0wx6D52A54D * Word.fromInt (Array.length a))
       fun vector aT = sequ VectorOps.ops (getT aT)
 
       val char = prim (Word.fromInt o ord)




More information about the MLton-commit mailing list