New hashcode function

db4
Daniel Ehrenberg 2007-11-23 23:54:56 -05:00
parent b5b0a5dae1
commit 9b0a6093ce
1 changed files with 8 additions and 1 deletions
core/sequences

View File

@ -667,7 +667,14 @@ PRIVATE>
: infimum ( seq -- n ) dup first [ min ] reduce ;
: supremum ( seq -- n ) dup first [ max ] reduce ;
! : sequence-hashcode ( n seq -- x )
! 0 -rot [
! hashcode* >fixnum swap 31 fixnum*fast fixnum+fast
! ] curry* each ; inline
: sequence-hashcode ( n seq -- x )
0 -rot [
hashcode* >fixnum swap 31 fixnum*fast fixnum+fast
hashcode* >fixnum swap
[ -2 shift fixnum+fast ] keep [ 5 shift fixnum+fast ] keep
bitxor
] curry* each ; inline