From c34b0b005b99e5b5ba8ff7b348d1d8d288f5641b Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 26 Jan 2017 19:44:32 -0800 Subject: [PATCH] Change string hash tables to support unicode strings. --- src/runtime/hashtb.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/runtime/hashtb.scm b/src/runtime/hashtb.scm index 8ac880948..cde06dd93 100644 --- a/src/runtime/hashtb.scm +++ b/src/runtime/hashtb.scm @@ -1024,9 +1024,9 @@ USA. ((%ratnum? key) (%ratnum->nonneg-int key)) ((flo:flonum? key) (%flonum->nonneg-int key)) ((%recnum? key) (%recnum->nonneg-int key)) - ((string? key) (string-hash key)) + ((ustring? key) (ustring-hash key)) ((bit-string? key) (bit-string->unsigned-integer key)) - ((pathname? key) (string-hash (->namestring key))) + ((pathname? key) (ustring-hash (->namestring key))) (else (eq-hash key)))) (define-integrable (%bignum? object) @@ -1223,7 +1223,7 @@ USA. (set! key-ephemeral-eqv-hash-table-type (make eqv-hash-mod eqv? #t hash-table-entry-type:key-ephemeral)) (set! string-hash-table-type - (make string-hash-mod string=? #t hash-table-entry-type:strong)) + (make ustring-hash ustring=? #t hash-table-entry-type:strong)) (set! strong-eq-hash-table-type ;Open-coded (open-type! eq-hash-mod eq? #t hash-table-entry-type:strong)) (set! strong-eqv-hash-table-type @@ -1286,9 +1286,11 @@ USA. (make-hash-table-type key-hash key=? (if (and (or (eq? key=? string=?) - (eq? key=? string-ci=?)) + (eq? key=? string-ci=?) + (eq? key=? ustring=?)) (or (eq? key-hash string-hash-mod) (eq? key-hash string-hash) + (eq? key-hash ustring-hash) (eq? key-hash hash) (eq? key-hash string-ci-hash))) #f ;No rehash needed after GC -- 2.25.1