diff options
Diffstat (limited to 'csc/hash-map.csc')
| -rw-r--r-- | csc/hash-map.csc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/csc/hash-map.csc b/csc/hash-map.csc index 064b4ae..682fa30 100644 --- a/csc/hash-map.csc +++ b/csc/hash-map.csc @@ -217,7 +217,7 @@ (define (shuffle n) - (truncate-remainder + (remainder (* #x9e3779b97f4a7c55 n) #x10000000000000000)) @@ -291,11 +291,12 @@ (define (hash-bytevector b) - (let loop ((i 0) - (hash 0)) - (if (>= i (bytevector-length b)) - hash - (loop (+ 1 i) (+ (* hash #x100) (bytevector-u8-ref b i)))))) + (loop for i from 0 below (bytevector-length b) + with hash = 0 + do (set! hash (remainder + (+ (* hash #x100) (bytevector-u8-ref b i)) + #x10000000000000000)) + finally (return hash))) (define compare-symbols |
