Sequence hashcode
parent
c0d2654618
commit
cd86eb8feb
|
@ -674,9 +674,13 @@ PRIVATE>
|
||||||
! hashcode* >fixnum swap 31 fixnum*fast fixnum+fast
|
! hashcode* >fixnum swap 31 fixnum*fast fixnum+fast
|
||||||
! ] curry* each ; inline
|
! ] curry* each ; inline
|
||||||
|
|
||||||
|
: sequence-hashcode-step ( oldhash newpart -- newhash )
|
||||||
|
swap [
|
||||||
|
dup -2 shift swap 5 shift
|
||||||
|
fixnum+fast fixnum+fast
|
||||||
|
] keep bitxor ;
|
||||||
|
|
||||||
: sequence-hashcode ( n seq -- x )
|
: sequence-hashcode ( n seq -- x )
|
||||||
0 -rot [
|
0 -rot [
|
||||||
hashcode* >fixnum swap
|
hashcode* >fixnum sequence-hashcode-step
|
||||||
[ -2 shift fixnum+fast ] keep [ 5 shift fixnum+fast ] keep
|
|
||||||
bitxor
|
|
||||||
] curry* each ; inline
|
] curry* each ; inline
|
||||||
|
|
Loading…
Reference in New Issue