From: Chris Hanson Date: Fri, 27 Jan 2017 03:44:32 +0000 (-0800) Subject: Change string hash tables to support unicode strings. X-Git-Tag: mit-scheme-pucked-9.2.12~227^2~64 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c34b0b005b99e5b5ba8ff7b348d1d8d288f5641b;p=mit-scheme.git Change string hash tables to support unicode strings. --- 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